MS Excel Cell Value TRUE throwing Error of data mismatch on Using SQL RRS feed

  • Question

  • I am applying SQL Command on Excel File to Read data to a Dataset to fill a Datagridview. One of the Columns has a String Value of "TRUE". On attempting to Use  WHERE Clause with this Column, 

    .Fill(tDtSet, 0, MaxNumberOfRecordsinXlsx, "Orders.xlsx")

     is throwing Datatype mismatch error

    Please advise.

    Saturday, August 15, 2015 6:10 AM


  • I Got It....Just use True value as Boolean.True rather than String in the SQL Statement

    For eg: Use this

       " AND YesNo = " & True

     instead of this 

     " WHERE YesNo = " & """" & "TRUE" & """"

    • Marked as answer by RakLali Saturday, August 15, 2015 6:31 AM
    Saturday, August 15, 2015 6:31 AM