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

Explain the main differences between asp and asp.net?

521


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

1620


How Can assign alias name for ASP.NET Web API Action?

942


I want to connect a system in LAN and I want to access that. Whenever I am moving a mouse in my desktop, the similar thing has to happen in another system in which I have connected. I need coding for this in C# and ASP.NET Can anyone please help me. It is very urgent. Thanks in advance. My email id is manojkumarchallagundla@gmail.com Will you please?

1462


How to handle errors in Web API?

628






What is a Cookie? Where is it used in ASP.NET?

614


Why mvc is better than asp.net? : Asp.Net MVC

473


Are cookies client side or server side?

500


Explain serialization and deserialization?

553


What is a user session?

505


What are the different types of proxy patterns?

598


What is the latest version of asp.net?

539


How information about the user's locale can be accessed?

585


Describe how to implement globalization and localization in the use interface in .net.

567


What does occur first in ASP.Net, Authentication or Authorization?

566