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


            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)
            myReader = myCommand.ExecuteReader()

            DeviseFournisseur = myReader.GetString(0)


            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
        End Try

The error occur when the tread pass the SQL request

Does someone can help me!!!

You declare the varible as
dim no as double=Val(Textbox1.text)

Edited 3 Years Ago by Reverend Jim: typo

This question has already been answered. Start a new discussion instead.