How far are you into architecting this?
This routine does a refresh of a row in a datatable
That was one of the battles I fought trying to achieve this.Code:Private Sub RefreshRow(ByVal VendorId As String, Optional ByVal dr As DataRow = Nothing) Dim rrStep As String = "Err @1" If VendorId <> "" Then Try rrStep = "Err @2" _inrefresh = True Using cmd As New SqlCommand cmd.CommandType = CommandType.Text cmd.CommandText = "Select * From Vendor_V Where VendorId=" & VendorId cmd.Connection = _connection _connection.Open() rrStep = "Err @3" Using rdr As SqlDataReader = cmd.ExecuteReader rrStep = "Err @4" If rdr.Read() Then rrStep = "Err @5" If dr Is Nothing Then dr = _vendortable.Rows.Find(VendorId) rrStep = "Err @6" For Each dc As DataColumn In dr.Table.Columns If Not dc.ReadOnly Then dr.Item(dc.ColumnName) = rdr.Item(dc.ColumnName) Next rrStep = "Err @7" dr.AcceptChanges() End If End Using End Using Catch ex As Exception MessageBox.Show(ex.Message, "Unknown Errors on VendorBal_C.RefreshRow at step " & rrStep, MessageBoxButtons.OK, MessageBoxIcon.Error) Finally _inrefresh = False _connection.Close() End Try End If End Sub
As you can see I'm currently debugging multi-user issues and have some debug messages in place...




Reply With Quote