L
Luis Esteban Valencia
Can somebody pllease tell me what is the error on this code. I got the error
on the executereader line.
Public Function verificarcedula(ByVal cedula As String) As Boolean
Dim mycmd As SqlCommand = New SqlCommand("select * from maestro where
cod_empl=@cedula", SqlConnection1)
mycmd.Parameters.Add("@cedula", cedula)
Dim myreader As SqlDataReader
Try
SqlConnection1.Open()
myreader = mycmd.ExecuteReader
If (myreader.Read) Then
Return True
Else
Return False
End If
Catch ex As Exception
Throw ex
Finally
myreader.Close()
SqlConnection1.Close()
End Try
End Function
on the executereader line.
Public Function verificarcedula(ByVal cedula As String) As Boolean
Dim mycmd As SqlCommand = New SqlCommand("select * from maestro where
cod_empl=@cedula", SqlConnection1)
mycmd.Parameters.Add("@cedula", cedula)
Dim myreader As SqlDataReader
Try
SqlConnection1.Open()
myreader = mycmd.ExecuteReader
If (myreader.Read) Then
Return True
Else
Return False
End If
Catch ex As Exception
Throw ex
Finally
myreader.Close()
SqlConnection1.Close()
End Try
End Function