C#, VFP,  ERROR [22018] [Microsoft][ODBC Visual FoxPro Driver]Operator/operand type mismatch.

    Question by:
    On

    Topics:

    I am trying to pass a DateTime value to my FoxPro database in C# and getting the following exception
     ERROR [22018] [Microsoft][ODBC Visual FoxPro Driver]Operator/operand type mismatch.

    I have tried passing value in many  different ways such via query string, or inline with query but failed.

    I am only getting this exception while passing the  DateTime, I can pass any other data type in the query.

    Your help is much appreciated.

     

    Verified Answer?

    The member who asked this question verified this comment provided the solution that solved their problem.

    by:Posted on 2007-08-31 at 05:33:54ID: 19807537

    What happened when you did this?

    thisCommand.CommandText = string.Format("Select * From CMS Where odr_date > {{^{0}}}", dt1.ToString("yyyy-MM-dd"));

    Bob

    This content is available to Experts Exchange members

    See the answer now
    with your Free 30 Day Trial

    Get unlimited access to solutions & experts

    • 4,169,477 solved questions
    • 3,805 articles & videos
    • 15,413 tech experts

    Get Access Now

    Ask Your Tech Question. Get Expert Solutions.We will email you when an expert has commented on your question.

    We will never share this with anyone. Privacy Policy Terms of Use

    Select topics

    You may select up to five topics.

    Top Expert Contributor

    Essential articles and videos from the Experts

    More valuable questions with Expert answers

    201507-LO-Qu-065

    EXPERT WHO ANSWERED

    Bob Learned

    Bob Learned has answered 10,935 questions on Experts Exchange and is an expert in C#, .NET Programming and Visual Basic.NET.

    RELATED TOPICS view all topics

    1. .NET Programming
      (129,725)
    2. ASP.NET
      (121,164)
    3. Visual Basic.NET
      (90,494)
    4. MS Development
      (48,487)
    5. Editors IDEs
      (25,028)
    6. Programming
      (50,764)
    7. MS SQL Server
      (152,783)
    8. JavaScript
      (116,298)
    9. XML
      (19,633)
    10. Programming Languages
      (19,434)