Andrew
When connection to database is failed, Which exception will be thrown?
Posted by Andrew in Database | SQL Server on Aug 17, 2011
0
Do you know the answer for this question? Post it below.
Guest

It depends specifically on which one you use. The DataException class collects errors specific to ADO.NET components, and the SqlException class is used to capture messages specifically regarding SQL Server and ops in the System.Data.SqlClient classes. Depending on what you're specifically trying to do, you can attempt a connection in a try/catch block and throw specific information regarding the exception. See http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlexception.aspx for more information.

Posted by Jon Guenther on Aug 23, 2011
Sponsored by
Nevron Gauge for SharePoint
Become a Sponsor
PREMIUM SPONSORS
  • ceTE software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and new content to existing PDF documents from within your applications.
    The leading .NET charting control now features PDF, Flash and Silverlight export, visualization of large datasets and more. Deliver true charting functionality to your BI, Scorecard, Presentation or Scientific apps. Download evaluation now.
Sponsored by
6 Months Free & No Setup Fees ASP.NET Hosting!
Become a Sponsor
PRIVACY POLICY | TERMS & CONDITIONS | SITEMAP | CONTACT US | REPORT ABUSE © 2011 C# Corner. All contents are copyright of their authors.