Dataconnection error messages

  • Thread starter Thread starter R
  • Start date Start date
R

R

I am new to .net but have user vb6 and in vb6 I got error messages on
everythin (that war an error..)
In .net I don't get errors when performin databare operations... the code
just exits (like exit sub)
Is there any way I could get the errormessages on this?

Ex. the line
RS23DataAdapter.Fill(RS23DataSet, "Employees")

Just exits without telling me why...



Ronny
 
Hi R

Just do

try
RS23DataAdapter.Fill(RS23DataSet, "Employees")
Catch sqlExc As SqlException 'if it is SQL and else OledbException
MessageBox.Show(sqlExc.ToString)
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try

I hope this helps?

Cor
 
OK, can I use this for general error trapping for my entire sub? Or must I
have this after each "operation"?
Cuold you explain in details how this work?

Ronny
 
Hi R,
Narrow it there where can be an exception.
Why do it for the full sub if an exception is impossible?
Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top