Solved

hi,

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Normally the drop down box control found in the .Net framework tools is able to select just one data and value at a time, which is displayed on the text area.   But what if you want to have multiple values to be selected in the drop down box? As …
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

707 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

18 Experts available now in Live!

Get 1:1 Help Now