Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / January 2008

Tip: Looking for answers? Try searching our database.

XML and Dataset

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Franck - 03 Jan 2008 14:16 GMT
I load XML inside Dataset. I normally use the SQL database but the
user can go in offline mode which create XML file on the HD. I load
them with no problem, now the problem is the request i was using to
query the table have to be done in XML also. How can you sort on a
field substring.

ORIGINAL SQL STATEMENT
string LoadSQL = "SELECT UnitNumber, Options, Value FROM
ModelSelection_Data WHERE (JobId = " + ModelSelectionGlobal.JobID + ")
AND (Revision = " + ModelSelectionGlobal.RevisionID + ") AND (Quantity
= " + ModelSelectionGlobal.NumberOfUnits + ") AND (Options = 'A3' OR
Options = 'A7' OR Options = 'Z1' OR Options = 'Z3' OR Options = 'Z4')
ORDER BY UnitNumber, LEFT(Options, 1), CONVERT(int, RIGHT(Options,
LEN(Options) - 1))";

THIS IS THE XML ONE
i loaded the XML which contain all the record on the table (+/- 600
records) now i need to do my sql statement on it.
Later with other request ill need to do Union query on the dataset i
need to find a way to make that work also.

dsLoadData.Tables[0].Select("JobId = " + ModelSelectionGlobal.JobID +
" AND Revision = " + ModelSelectionGlobal.RevisionID + " AND Quantity
= " + ModelSelectionGlobal.NumberOfUnits + " AND (Options = 'A3' OR
Options = 'A7' OR Options = 'Z1' OR Options = 'Z3' OR Options =
'Z4')", "UnitNumber, LEFT(Options, 1), CONVERT(int, RIGHT(Options,
LEN(Options) - 1)");

that doesn't work because of the convert wich is SQL statement and not
dataset sorting statement.
Ignacio Machin ( .NET/ C# MVP ) - 03 Jan 2008 15:00 GMT
Hi,

You will have to use the data stored in the dataset to filter it. DataView
has a good number of options to allow you do that.

Take a look at the docs.

Signature

Ignacio Machin
http://www.laceupsolutions.com
Mobile & warehouse Solutions.

>I load XML inside Dataset. I normally use the SQL database but the
> user can go in offline mode which create XML file on the HD. I load
[quoted text clipped - 26 lines]
> that doesn't work because of the convert wich is SQL statement and not
> dataset sorting statement.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.