A
Aaron
Hi all,
I am trying to insert a whole dataset from my web service into a
SQLCE database. I am unsucessful so far. Any help is appreciated.
Here is what I have so far (the dataset is returned fine). I think my
problem lies in the fact that the rowstate is unchanged. I need it to
be add or even better yet, can it compare on its own??
Thanks, Aaron
-----------------------------------------------------------------------------
Public Sub SynchSQL2(ByVal ds As DataSet)
'connect locally to SQLCE
sqlConn = New SqlCeConnection(frmMain.connStr)
sqlConn.Open()
Dim dtSQL As DataTable
Dim dtCE As DataTable
Dim ds2 As DataSet = New DataSet
Dim cb As SqlCeCommandBuilder
Try
Dim dsupdate As New DataSet
'this is one table I am trying to "synch"
sqlDA = New SqlCeDataAdapter("select id,branch from
branch", sqlConn)
'create the commands
cb = New SqlCeCommandBuilder(sqlDA)
'set dataadapter insert to created command
sqlDA.InsertCommand = cb.GetInsertCommand()
sqlDA.Update(ds, "branch")
Catch ex As Exception
MsgBox(ex.Message)
End Try
I am trying to insert a whole dataset from my web service into a
SQLCE database. I am unsucessful so far. Any help is appreciated.
Here is what I have so far (the dataset is returned fine). I think my
problem lies in the fact that the rowstate is unchanged. I need it to
be add or even better yet, can it compare on its own??
Thanks, Aaron
-----------------------------------------------------------------------------
Public Sub SynchSQL2(ByVal ds As DataSet)
'connect locally to SQLCE
sqlConn = New SqlCeConnection(frmMain.connStr)
sqlConn.Open()
Dim dtSQL As DataTable
Dim dtCE As DataTable
Dim ds2 As DataSet = New DataSet
Dim cb As SqlCeCommandBuilder
Try
Dim dsupdate As New DataSet
'this is one table I am trying to "synch"
sqlDA = New SqlCeDataAdapter("select id,branch from
branch", sqlConn)
'create the commands
cb = New SqlCeCommandBuilder(sqlDA)
'set dataadapter insert to created command
sqlDA.InsertCommand = cb.GetInsertCommand()
sqlDA.Update(ds, "branch")
Catch ex As Exception
MsgBox(ex.Message)
End Try