hello people, I have the following piece of code.
Private Sub SR_No()
Dim con As New SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=C:\VB Applications\PROJECT_1\PROJECT_1\examdb.mdf;Integrated Security=True;User Instance=True")
Dim cmd As New SqlCommand("Select MAX(SR_No) from Stud_Master", con)
con.Open()
Dim dr As SqlDataReader = cmd.ExecuteReader()
MessageBox.Show(sr)
con.Close()
End Sub
I wish to fetch SR_No into a variable sr.
Advices are welcome.
Thanks