Solved

hi,

Posted on 2009-04-14
4
254 Views
Last Modified: 2013-12-17
Hi,

I tried accessing a DB using my C# code , but it is throwing SQL Exception 2146232060, now i want to ignore this error and proceed with execution of my program. Can you please provide me with the solution.

Thanks,
Sandy
0
Comment
Question by:sandy3024
  • 2
4 Comments
 
LVL 39

Accepted Solution

by:
abel earned 250 total points
ID: 24136647
try something like this:

try 

{
 

    // open your database connection that throws the exception 

    // i.e., your current code
 

}

catch (SQLException e)

{

    // do something, or nothing, with exception here 

}
 

// program continues from here after exception handline

Open in new window

0
 
LVL 39

Expert Comment

by:abel
ID: 24136661
If it is not an SQLException that you are receiving, but something else, then you can add more catch-blocks below the one I showed to have a handler for each exception you need.
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 24136752
you might want to check your connection strings http://www.connectionstrings.com is a good site

Also according to this, it might be a database setting (thats if you are using sql server)
http://www.dreamincode.net/forums/showtopic32703.htm
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now