I have this problem,
I have a SQL code working perfectly on SQL Query windows...
SELECT ID_no, nom_navire, date_mes, date_sav, description, nom_fourn, no_facture, date_facture, accept, decline FROM DB_FACTURE WHERE( ID_no = 39)
Answer perfect
On my code Is ...
SELECT devise FROM FOURNISSEURS WHERE nom_fourn = '" + Nom_FournPass + "'
Nom_FournPass = 39 not '39' or "39" everithing look ok but receive this (Conversion from string "" to type 'Double' is not valid)
Here my compleate code
Dim connectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\Réclamation 2013-11.mdb"
Dim dbConnection As System.Data.IDbConnection = New System.Data.OleDb.OleDbConnection(connectionString)
Dim DeviseFournisseur As String
Dim Nom_FournPass As String = Nom_Fourn.SelectedItem
Try
Dim myReader As OleDb.OleDbDataReader
Dim mySelectQuery As String = "SELECT devise FROM FOURNISSEURS WHERE nom_fourn = '" + Nom_FournPass + "'"
Dim myConnection As New OleDb.OleDbConnection(connectionString)
Dim myCommand As New OleDb.OleDbCommand(mySelectQuery, myConnection)
myConnection.Open()
myReader = myCommand.ExecuteReader()
myReader.Read()
DeviseFournisseur = myReader.GetString(0)
myReader.Close()
myConnection.Close()
If DeviseFournisseur = "us" Then USD_INV.CheckState = CheckState.Checked
If Not DeviseFournisseur = "us" Then USD_INV.CheckState = CheckState.Unchecked
If DeviseFournisseur = "eu" Then EU_INV.CheckState = CheckState.Checked
If Not DeviseFournisseur = "eu" Then EU_INV.CheckState = CheckState.Unchecked
Catch ex As Exception
MsgBox(ex.Message.ToString)
End Try
The error occur when the tread pass the SQL request
Does someone can help me!!!