I am new to vb.net and having fun learning. My Drd variable is declared public in my module. When I run this code. I get the error, "Object reference not set to an instance of an object."
Private Sub btnSubmit_Click(sender As Object, e As EventArgs) Handles btnSubmit.Click
Dim fname As String = txtFName.Text
Dim lname As String = txtLName.Text
Dim odt As Date = dtNurse.Value
Dim symp As String = lstSymptom.SelectedItem
Dim observ As String = txtAction.Text
CurrentRow = 0
Dad = New OleDbDataAdapter("SELECT Student_UID FROM tblElemStudents where First_Name = '" & fname.Replace("'", "''") & _
"' and Last_Name = '" & lname.Replace("'", "''") & "'", Cnn)
Drd = Cmd.ExecuteReader
Everything runs fine up to the last line of code above. What am I doing wrong?
Thanks in advance.