System.Transactions.Diagnostics.DiagnosticTrace throws an exception of initialization

  • Thread starter Thread starter Wavounet
  • Start date Start date
W

Wavounet

I use .Net 2.0 and connect to a database access, on the
connection.open() I've this message "The type initializer for
'System.Transactions.Diagnotics.DiagnosticTrace' threw an exception"


Code :

public DataSet GetData(string SqlQuery)
{
using (OleDbConnection connection = new
OleDbConnection(m_ConnectionString))
{

connection.Open();

OleDbCommand command = new OleDbCommand(SqlQuery,
connection);

command.CommandType = CommandType.Text;

OleDbDataAdapter adapter = new
OleDbDataAdapter(command);

DataSet ds = new DataSet();

adapter.Fill(ds);

connection.Close();

return ds;
}
}

Thanks for your help
 
By Deleting the Config.app & rebuilding the project we can get this
problem solved, but be sure to take backup copy of your work before
doing this

I get solved this problem doing this
 
Back
Top