G
Guest
Hello
I can't get my update command to work..
I've used the sqlDataAdapter wizard to create a dataAdapter sqlDA_CB_LP, and it created the 'UPDATE' code as follows
Me.sqlDA_CB_LP.UpdateCommand = Me.SqlUpdateCommand
Me.SqlUpdateCommand4.Connection = Me.SqlConnection
Me.SqlUpdateCommand4.Parameters.Add(New System.Data.SqlClient.SqlParameter("@STR_COMMENT", System.Data.SqlDbType.NVarChar, 1073741823, "STR_COMMENT")
In my sub that populates the form
cbLP = New SqlCommandBuilder(sqlDA_CB_LP
dsCBLP1.clear(
sqlDA_CB_LP.fill(dsCBLP1
dvCB_LP = New Datavie
with dvCB_L
.table = dsCBLP1.Tables("TDT_CUT_BLOCK_LP"
.RowFilter = "ID_CUT_BLOCK = '" & txtBlockID.Text & "'
End Wit
Me.txtLPComm.DataBindings.Add("text", dvCB_LP, "STR_COMMENT"
Then under my "Save" button
Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As EventArgs) Handles btnSave.Clic
Tr
sqlDA_CB_LP.Update(DsCBLP1, "TDT_CUT_BLOCK_LP"
Catch ex As Exceptio
MessageBox.Show(ex.Message
End Tr
End Su
But, it doesn't work..
Any ideas what I'm doing wrong?
Thanks
Ambe
I can't get my update command to work..
I've used the sqlDataAdapter wizard to create a dataAdapter sqlDA_CB_LP, and it created the 'UPDATE' code as follows
Me.sqlDA_CB_LP.UpdateCommand = Me.SqlUpdateCommand
Me.SqlUpdateCommand4.Connection = Me.SqlConnection
Me.SqlUpdateCommand4.Parameters.Add(New System.Data.SqlClient.SqlParameter("@STR_COMMENT", System.Data.SqlDbType.NVarChar, 1073741823, "STR_COMMENT")
In my sub that populates the form
cbLP = New SqlCommandBuilder(sqlDA_CB_LP
dsCBLP1.clear(
sqlDA_CB_LP.fill(dsCBLP1
dvCB_LP = New Datavie
with dvCB_L
.table = dsCBLP1.Tables("TDT_CUT_BLOCK_LP"
.RowFilter = "ID_CUT_BLOCK = '" & txtBlockID.Text & "'
End Wit
Me.txtLPComm.DataBindings.Add("text", dvCB_LP, "STR_COMMENT"
Then under my "Save" button
Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As EventArgs) Handles btnSave.Clic
Tr
sqlDA_CB_LP.Update(DsCBLP1, "TDT_CUT_BLOCK_LP"
Catch ex As Exceptio
MessageBox.Show(ex.Message
End Tr
End Su
But, it doesn't work..
Any ideas what I'm doing wrong?
Thanks
Ambe