Solved

hi,

Posted on 2009-04-14
4
274 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

735 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