user3300714
user3300714

Reputation: 33

An unhandled exception of type 'System.IO.FileLoadException' occurred in exe

while using a sql query with function

private void DisplayAll(string sql)
        {
            SQLiteConnection connection = new SQLiteConnection(cString);
            connection.Open();
            SQLiteDataAdapter dataadapter = new SQLiteDataAdapter(sql, connection);
            DataTable dt = new DataTable();
            dataadapter.Fill(dt);
            dataGridView1.DataSource = dt;
            connection.Close();

        }

information: Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information. how to solve this

Upvotes: 3

Views: 15711

Answers (1)

AbdulRahman Ansari
AbdulRahman Ansari

Reputation: 3057

Try to use this startup tag in your app.config under configuration node

<startup useLegacyV2RuntimeActivationPolicy="true">
  <supportedRuntime version="v4.0"/>
</startup>

Upvotes: 9

Related Questions