Can anyone please tell me how do I get the total row in my ms access table and put in my label.text at vb.net?

This is how I did it.

 Sub countR()
 ConnDB()
 Dim sql As String = "select COUNT (*) FROM register"
 Dim cmd As New OleDbCommand(sql, conn)
 dr = cmd.ExecuteReader()
 While (dr.Read())
 lblTotalR.Text = (dr(0).Tostring())
 End While
 End Sub
commented: Where is dr declared and how do you delcare dr +0

thank you sir, working 100%

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.