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.

    Good Question?
    0
     

    ?

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

    Accepted Solution 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

    Top Expert Contributor

    Essential articles and videos from the Experts

    More valuable questions with Expert answers

    201601-LO-Qu-076

    Extend your technology team with the Experts Exchange community.

    — trusted by —

    Who answers my questions?Our community has technology experts around the world.

    käµfm³d   👽

    9

    Articles

    7,460

    Solutions

    Expert in:

    • .NET Programming
    • C#
    • Visual Basic.NET
    • ASP.NET
    • Regular Expressions

    Lokesh B R

    205

    Solutions

    Expert in:

    • .NET Programming
    • ASP.NET
    • C#
    • Visual Basic.NET

    Alexandre Simões

    6

    Articles

    1,019

    Solutions

    Expert in:

    • .NET Programming
    • C#
    • JavaScript
    • Visual Basic.NET
    • ASP.NET

    AndyAinscow

    11

    Articles

    3,144

    Solutions

    Expert in:

    • .NET Programming
    • C#
    • System Programming
    • Visual C++.NET
    • C++

    Fernando Soto

    5,013

    Solutions

    Expert in:

    • .NET Programming
    • Visual Basic.NET
    • C#
    • ASP.NET
    • Editors IDEs

    it_saige

    1,037

    Solutions

    Expert in:

    • .NET Programming
    • C#
    • Visual Basic.NET
    • ASP.NET
    • Active Directory

    Kyle Abrahams

    2,140

    Solutions

    Expert in:

    • .NET Programming
    • ASP.NET
    • C#
    • MS SQL Server
    • MS SQL Server 2008

    zephyr_hex

    2,543

    Solutions

    Expert in:

    • MS SharePoint
    • MS SQL Server 2005
    • Microsoft IIS Web Server
    • Windows 2003 Server
    • Windows XP

    sarabande

    1,329

    Solutions

    Expert in:

    • C++
    • C
    • Visual C++.NET
    • .NET Programming
    • MS Development-Other

    RELATED TOPICS view all topics

    1. .NET Programming
      (131,132)
    2. ASP.NET
      (122,113)
    3. Visual Basic.NET
      (91,453)
    4. MS Development-Other
      (48,696)
    5. Editors IDEs
      (25,096)
    6. Programming-Other
      (51,628)
    7. MS SQL Server
      (154,713)
    8. JavaScript
      (117,356)
    9. XML
      (19,778)
    10. WCF
      (4,300)