F
Franck
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.
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.