How to correct the error when odbc Exception was unhandled?
Code:
Private Function search(ByVal username As String) As Boolean
' Try
Dim Sql As String
Sql = "Select * from login where UserName='" & username & "'"
Dim objdataAdapter As New OdbcDataAdapter(Sql, objconn)
Dim objDataSet As New DataSet
objdataAdapter.Fill(objDataSet, ("Login"))
Dim objdataview As DataView
objdataview = New DataView(objDataSet.Tables("Login"))
If objdataview.Count > 0 Then
Return True
Else
Return False
End If
'Catch ex As Exception
' MsgBox(ex.Message)
' End Try
End Function
End Class
Comment