By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,534 Members | 950 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,534 IT Pros & Developers. It's quick & easy.

how to correct the error when odbc Exception was unhandled?

P: 1
How to correct the error when odbc Exception was unhandled?

Expand|Select|Wrap|Line Numbers
  1. Private Function search(ByVal username As String) As Boolean
  2.         ' Try
  3.         Dim Sql As String
  4.         Sql = "Select * from login where UserName='" & username & "'"
  5.         Dim objdataAdapter As New OdbcDataAdapter(Sql, objconn)
  6.         Dim objDataSet As New DataSet
  7.         objdataAdapter.Fill(objDataSet, ("Login"))
  8.         Dim objdataview As DataView
  9.         objdataview = New DataView(objDataSet.Tables("Login"))
  10.         If objdataview.Count > 0 Then
  11.             Return True
  12.         Else
  13.             Return False
  14.         End If
  15.         'Catch ex As Exception
  16.         '  MsgBox(ex.Message)
  17.         ' End Try
  18.     End Function
  19.  
  20. End Class
Oct 26 '12 #1
Share this Question
Share on Google+
3 Replies


PsychoCoder
Expert Mod 100+
P: 465
Why not start with giving more information about what's going wrong with the code you've provided
Oct 26 '12 #2

Frinavale
Expert Mod 5K+
P: 9,731
You have commented out the code that will handle the exception and display the message.

Could you please explain what error you are seeing? There are several different odbc exceptions.

It is good practice to only catch the exceptions that you can deal with.

-Frinny
Oct 26 '12 #3

tsanalista
P: 11
Show Message Error brother....
Nov 20 '12 #4

Post your reply

Sign in to post your reply or Sign up for a free account.