mathieu_cupryk
asked on
Record count not being incremented,
Public Sub DoAddnew()
Dim bm As BindingManagerBase = Me.DataGrid1.BindingContex t(Me.DataG rid1.DataS ource, Me.DataGrid1.DataMember)
Dim dr As DataRow = CType(bm.Current, DataRowView).Row
Dim addform As New AddTransOverride(dr)
Dim retval As DialogResult = addform.ShowDialog()
If retval = DialogResult.OK Then
bm.EndCurrentEdit()
Try
Dim substr As String = dr.Item(4)
If substr Is System.DBNull.Value Then
substr = ""
End If
If Not substr = "" Then
substr = substr.Substring(0, 2)
End If
ExecOnTransOverride.ins(dr .Item(1), dr.Item(2), dr.Item(3), substr, dr.Item(5), dr.Item(6), dr.Item(8), dr.Item(7), DateTime.Now, dr.Item(7), dr.Item(9))
MsgBox("Data Inserted Successfully !", MsgBoxStyle.Information, Me.Text)
Me.lbNumRec.Text = dv.Count.ToString()
Catch se As SqlException
MessageBox.Show(se.Message )
Catch ex As Exception
MessageBox.Show(ex.Message )
End Try
Else
bm.CancelCurrentEdit()
End If
End Sub
This is not incrementing the count label Me.lbNumRec.Text = dv.Count.ToString()
Dim bm As BindingManagerBase = Me.DataGrid1.BindingContex
Dim dr As DataRow = CType(bm.Current, DataRowView).Row
Dim addform As New AddTransOverride(dr)
Dim retval As DialogResult = addform.ShowDialog()
If retval = DialogResult.OK Then
bm.EndCurrentEdit()
Try
Dim substr As String = dr.Item(4)
If substr Is System.DBNull.Value Then
substr = ""
End If
If Not substr = "" Then
substr = substr.Substring(0, 2)
End If
ExecOnTransOverride.ins(dr
MsgBox("Data Inserted Successfully !", MsgBoxStyle.Information, Me.Text)
Me.lbNumRec.Text = dv.Count.ToString()
Catch se As SqlException
MessageBox.Show(se.Message
Catch ex As Exception
MessageBox.Show(ex.Message
End Try
Else
bm.CancelCurrentEdit()
End If
End Sub
This is not incrementing the count label Me.lbNumRec.Text = dv.Count.ToString()
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Sometimes a second set of eyes is all you need. We've all been there.
ASKER
Thanks.