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