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?