how to handle sql exceptions?

Answer Posted / minhajul islam

using try block we can trap the error as follows

try
{
//Datanase coding
}
catch(SQLException e1)
{
//Here you will get SQL Error message in e1 instance
}

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between client-side and server-side validations in ASP.NET?

851


How is my content secured from unauthorized access?

697


Which is better session or viewstate?

680


How do I publish my asp.net application to my isp's web server?

779


can s/w quality assurance engineer switch field to programming side i m very much interested in programming but not much good in it

1654






What is in a session cookie?

700


What is the difference between response.redirect and server.transfer?

718


Any one can tell how we store tiff format images in database and retrive from the database(need for tiff format only)

1797


What is strong-typing versus weak-typing?

779


What is a response cookie?

810


Explain about Application and Session Events ?

803


Explain the difference between server.transfer and response.redirect? Why would I choose one over the other?

738


What is state management in .net?

793


What is meant by ispostback in asp net?

743


Differentiate between a page theme and a global theme?

702