Can someone please tell me how to reset a DataAdapter to update the file a second time?
The first time it works fine, then on an edit I delete the records and call the .Update again and it does nothing that I can see.
Why?
I've searched for an answer but haven't used this object before but it does a great job of saving records passed around in my web site, then I dump it to a SQL Server data table.
My Code
Thanks ahead of time.
The first time it works fine, then on an edit I delete the records and call the .Update again and it does nothing that I can see.
Why?
I've searched for an answer but haven't used this object before but it does a great job of saving records passed around in my web site, then I dump it to a SQL Server data table.
My Code
Code:
Dim strSQLAdd As String = "SELECT report_id, user_id, report_name, field_sequence, report_desc, field_name, sort_seq, sort_order, report_public FROM User_Reports WHERE report_id = " & iReportID
MyDataAdapter = New SqlClient.SqlDataAdapter(strSQLAdd, MyConnection)
Dim MyCommandBuilder As SqlCommandBuilder = New SqlCommandBuilder(MyDataAdapter)
Try
MyDataAdapter.Update(tblReportInfoTable)
Catch ex As Exception
lblMessage.Text = "Could not save your Report because: " & ex.ToString()
lblMessage.Visible = True
Return False
Finally
MyConnection.Close()
End Try
MyDataAdapter.Dispose()
MyConnection.Dispose()
Thanks ahead of time.