Very odd behavior. I try to fill two dataadapters on the same connection and
I get an exception on the 2nd fill. Code similar to this has never been a
problem in my winforms app, so this must be some limitation of CF?

Dim strSQLServer As New SqlCeConnection(strConn)
Dim cmd As New SqlCeCommand
cmd.CommandType = CommandType.Text
cmd.CommandText = "Select * From Employees"
cmd.Connection = strSQLServer

Dim cmdPPC As New SqlCeCommand
cmdPPC.CommandType = CommandType.Text
cmdPPC.CommandText = "Select * From PocketPCs"
cmdPPC.Connection = strSQLServer

strSQLServer.Open()

Dim da As New SqlCeDataAdapter(cmd)
da.Fill(ds, "dtCanvassers")
Dim da2 As New SqlCeDataAdapter(cmdPPC)

'an exception occurs here
da2.Fill(ds, "dtPocketPCs")

Re: Using multiple dataadapters does not work in CF??? by Earl

Earl
Wed Nov 10 21:43:48 CST 2004

Ewwwwww ... wiping the egg off my face here. I'd added the PocketPC table
after finishing the database design but had failed to go back and include it
in the merge publication. Further review in the query analyzer confirmed no
table had been downloaded to the onboard sqlce db.

"Earl" <brikshoe@newsgroups.nospam> wrote in message
news:O7LtV65xEHA.3976@TK2MSFTNGP09.phx.gbl...
> Very odd behavior. I try to fill two dataadapters on the same connection
> and I get an exception on the 2nd fill. Code similar to this has never
> been a problem in my winforms app, so this must be some limitation of CF?
>
> Dim strSQLServer As New SqlCeConnection(strConn)
> Dim cmd As New SqlCeCommand
> cmd.CommandType = CommandType.Text
> cmd.CommandText = "Select * From Employees"
> cmd.Connection = strSQLServer
>
> Dim cmdPPC As New SqlCeCommand
> cmdPPC.CommandType = CommandType.Text
> cmdPPC.CommandText = "Select * From PocketPCs"
> cmdPPC.Connection = strSQLServer
>
> strSQLServer.Open()
>
> Dim da As New SqlCeDataAdapter(cmd)
> da.Fill(ds, "dtCanvassers")
> Dim da2 As New SqlCeDataAdapter(cmdPPC)
>
> 'an exception occurs here
> da2.Fill(ds, "dtPocketPCs")
>