what Exception class(s) we can use while writing database connection code in c#.net [Resolved]

Posted by Udaysimha under C# on 1/5/2012 | Points: 10 | Views : 2228 | Status : [Member] | Replies : 5
Hi All,

What are the Exception calsses available in .net to track excetions which occure in database connection related code in c#.net. Any help would be appreciated.

Thanks in Advanced
Uday

uday


Responses

Posted by: Awakale.gajanan on: 1/6/2012 [Member] Starter | Points: 50

Up
0
Down

Resolved
SQLException Exception calss is available in .net to track exceptions which occurs in database connection and retrieval of data from data.


I hope this will help you


Regards,
Gajanan Awakale
09975635088

Udaysimha, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Awakale.gajanan on: 1/6/2012 [Member] Starter | Points: 50

Up
0
Down

Resolved
when you are writing code use try-catch block.
try
{
//sqlconnection,
//query,storeprocedure
}
catch(sqlexception sql)
{
//code here what u want to perform after exception occurs
}


Regards,
Gajanan Awakale
09975635088

Udaysimha, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Udaysimha on: 1/6/2012 [Member] Starter | Points: 25

Up
0
Down
Hi Gajanan,

Thanks for your reply, your answer is defiantly help me, please could you give me some code.

Regards
Uday

uday

Udaysimha, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Udaysimha on: 1/6/2012 [Member] Starter | Points: 25

Up
0
Down
Thanks boss

uday

Udaysimha, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Udaysimha on: 1/6/2012 [Member] Starter | Points: 25

Up
0
Down
what exception class we can use while connecting to Oracle database or Mysql database.

uday

Udaysimha, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response