Quantcast
Channel: Visual C# forum
Viewing all articles
Browse latest Browse all 31927

Error Occur when run from EXE The type initializer for 'System.Data.SqlClient.SqlConnection' threw an exception.

$
0
0

Hello Everybody,

this error is displaying when I run my application from EXE but everything is working properly when I run from SourceCode.

The type initializer for 'System.Data.SqlClient.SqlConnection' threw an exception.

my code :

SqlConnection_Connection ;

SqlConnection Reinitalise()

       {

           try

           {

                

               _Connection = new System.Data.SqlClient.SqlConnection(“Data Source=.;Initial Catalog=test;Integrated Security=True”);

                return _Connection;

           }

           catch (Exception ex)

           {

               DXMessageBox.Show(ex.Message);

               returnnull;

           }

       }

Error occurring when inilizing new connection (RedLine code ).

Please Suggest me what  would be problem.

My project is in wpf

my PC Configuration

VS 2012

Dot net 4

Window 7 , 8 64 bit


Prem Shah



Viewing all articles
Browse latest Browse all 31927

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>