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

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
 
A

atharvainfo

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top