Does SQL CE support multiple sql statement?

  • Thread starter Thread starter RockDale
  • Start date Start date
R

RockDale

Hello, everybody:

String sql = "SELECT * FROM TABLE1;SELECT * FROM TABLE2;";
try{
SqlCeDataAdapter da = new SqlCeDataAdapter(sql, mDBConn);
da.Fill(ds);
for(int i=0;i<tableName.Length ;i++)
{
ds.Tables.TableName = tableName;
}
}catch(Exception ex){
MessageBox.Show(ex.Message.ToString());
}

The above ds.Fill(ds) caught error with the error message is empty
string. (What's the Mircosoft thinking)

But if the sql contains only one sql statement, then everything is ok.

Also it get the correct data if I execute the multiple select statement
in sqlce analyzer.


How should I fill in multiple table in one dataset?
 
Batch queries are not supported by SQL CE:



http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_sqlserverce_705.asp



SqlCeException contains errors collection you should examine for error
messages:



http://msdn.microsoft.com/library/d...sqlservercesqlceexceptionclasserrorstopic.asp



Filling multiple tables involves executing several fills, one per table.



Best regards,



Ilya



This posting is provided "AS IS" with no warranties, and confers no rights.

*** Want to find answers instantly? Here's how... ***

1. Go to
http://groups-beta.google.com/group/microsoft.public.dotnet.framework.compactframework?hl=en
2. Type your question in the text box near "Search this group" button.
3. Hit "Search this group" button.
4. Read answer(s).
 
Back
Top