0

I'm uploading data from an Excel file into a database and it works fine sometimes, but other times I receive the following warning message that stops my program from working:

There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "System.Data.SQLite, Version=1.0.66.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=x86", "x86". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project.

The section of the code where this error occurs is :

Sqlconn = New MySqlConnection
Sqlconn.ConnectionString = "server=xxxxxx;userid=xxxxxx;password=xxxxxx;database=xxxxxx"
Dim reader As MySqlDataReader

    Try
        Sqlconn.Open()
        Dim query As String
        query = "insert into (xxxx) values ("xxxx")
        command = New MySqlCommand(query, Sqlconn)
        reader = command.ExecuteReader
        Sqlconn.Close()
    Catch ex As MySqlException
        MessageBox.Show(ex.Message)
    Finally
        Sqlconn.Dispose()
    End Try

The error occurs at line reader = command.ExecuteReader

Would someone be able to explain to me why this message is occurring and what is possible to eliminate it?

pnuts
  • 58,317
  • 11
  • 87
  • 139
Satvir Singh
  • 61
  • 4
  • 16
  • Doesn't seem to be a SQL/Excel problem, rather an x86/x64 dll incompatibility issue. May be you are using incorrect version of MySql connector/dll (32 bit, 64 bit). Have you tried changing `Platform` in `Build|Configuration Manager`. Check this SO post also [mismatch between processor architecture](http://stackoverflow.com/a/10196549/5104101) – haraman Oct 23 '15 at 09:12
  • Thank you so much. This removed the warning message – Satvir Singh Oct 23 '15 at 10:55

0 Answers0