Thanks.
Kerry,
ok, then i don't have to look any further when its not supported by SQL
Compact 3.5.
When I want a dataset with several db tables I suppose then I have to write
all queries in separate statements and build that way my dataset?
Guy
"Kerry Moorman" wrote:
> Guy,
>
> I don't believe SQL Compact Edition supports batch queries on a single
> command object.
>
> Kerry Moorman
>
>
> "Guy" wrote:
>
> > Thanks.
> >
> > but ... does this also work with SQL Compact 3.5?
> >
> > "Kerry Moorman" wrote:
> >
> > > Guy,
> > >
> > > Here is an example of batching 2 select statements:
> > >
> > > Dim cn As New SqlConnection("Data Source=(local)\SQLExpress;Initial
> > > Catalog=ProjectTrackerSQL;User ID=sa;Password=xxxx")
> > >
> > > Dim cmd As New SqlCommand
> > > Dim dr As SQLDataReader
> > > Dim dt1, dt2 As New DataTable
> > >
> > > cmd.CommandText = "Select * From Employees; Select * From Departments"
> > > cn.Open()
> > > cmd.Connection = cn
> > > dr = cmd.ExecuteReader(CommandBehavior.CloseConnection)
> > >
> > > dt1.Load(dr)
> > > MsgBox(dt1.Rows.Count)
> > >
> > > dt2.Load(dr)
> > > MsgBox(dt2.Rows.Count)
> > >
> > > dr.Close()
> > >
> > > Kerry Moorman
> > >
> > > "Guy" wrote:
> > >
> > > > is it possible to have several queries in 1 query command (as far as i read
> > > > on the Microsoft pages this should be possible but i don't succeed):
> > > > in fact something like:
> > > >
> > > > ...
> > > > string sql = string.Format(select * from A; select * from B;);
> > > > ...