Solved

hi,

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

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…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

777 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