Hai , i have a probleam to display total row from database after i delete current user. I am using button delete to remove data form database. After remove the data I want to display total current user form database .For this process i am using command me.StaffBindingSource .Count to get total of row from database.After i remove the current user i only get answer There Are 0 Staff Register .For your info i have 23 total row in my table which i name it as staff. Here is my coding which i am using sql 2005 and visual studio 2005. Please correct my coding please.
Public Class User
Dim count As Integer = 0
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnremove1.Click
MsgBox(" Are You Confirm ?", MsgBoxStyle.YesNo) = vbYes Then
Me.StaffBindingSource.RemoveCurrent()
Me.StaffBindingSource.EndEdit()
Me.StaffTableAdapter.Update(Me.LoginDataSet.staff)
Me.ValidateChildren()
count = Me.StaffBindingSource.Count
Label5.Text = "There Are " & count & " Staff Register"
End Sub
End class
Public Class User
Dim count As Integer = 0
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnremove1.Click
MsgBox(" Are You Confirm ?", MsgBoxStyle.YesNo) = vbYes Then
Me.StaffBindingSource.RemoveCurrent()
Me.StaffBindingSource.EndEdit()
Me.StaffTableAdapter.Update(Me.LoginDataSet.staff)
Me.ValidateChildren()
count = Me.StaffBindingSource.Count
Label5.Text = "There Are " & count & " Staff Register"
End Sub
End class