data type mismatch error

Discussion in 'ASP .Net' started by amitbadgi@gmail.com, Aug 10, 2005.

  1. Guest

    I am getting the following error while converting an asp application
    to asp.net

    Exception Details: System.Runtime.InteropServices.COMException: Data
    type mismatch in criteria expression.

    Source Error:

    Line 233:
    Line 234: rs =
    Server.CreateObject("ADODB.recordset")
    Line 235: rs.open(" Select * From tblEvent WHERE
    date_of_event = '" & currenttime & " ' ", conn, 1, 3)
    Line 236: 'response.Write(sql1)
    Line 237:


    Source File: C:\Documents and Settings\amit\WebSite1\calendar.aspx
    Line: 235

    Stack Trace:

    [COMException (0x80040e07): Data type mismatch in criteria expression.]

    Microsoft.VisualBasic.CompilerServices.LateBinding.InternalLateCall(Object
    o, Type objType, String name, Object[] args, String[] paramnames,
    Boolean[] CopyBack, Boolean IgnoreReturn) +776

    Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateCall(Object
    Instance, Type Type, String MemberName, Object[] Arguments, String[]
    ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack, Boolean
    IgnoreReturn) +193987
    ASP.calendar_aspx.__Render__control1(HtmlTextWriter __w, Control
    parameterContainer) in C:\Documents and
    Settings\amit\WebSite1\calendar.aspx:235
    System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer,
    ICollection children) +98
    System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +20
    System.Web.UI.Page.Render(HtmlTextWriter writer) +27
    System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer,
    ControlAdapter adapter) +53
    System.Web.UI.Control.RenderControl(HtmlTextWriter writer,
    ControlAdapter adapter) +280
    System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +24
    System.Web.UI.Page.ProcessRequestMain(Boolean
    includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    +8878
    , Aug 10, 2005
    #1
    1. Advertising

  2. Karl Seguin Guest

    My guess is that (a) either your date in an incorrect format, or (b) you
    should place it between # instead of '
    (http://support.microsoft.com/default.aspx/kb/175258)

    It's good that you are going the ASP.Net route, but why use a RecordSet when
    you could be using a DAtaReader?

    Karl

    --
    MY ASP.Net tutorials
    http://www.openmymind.net/ - New and Improved (yes, the popup is
    annoying)
    http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
    come!)
    <> wrote in message
    news:...
    > I am getting the following error while converting an asp application
    > to asp.net
    >
    > Exception Details: System.Runtime.InteropServices.COMException: Data
    > type mismatch in criteria expression.
    >
    > Source Error:
    >
    > Line 233:
    > Line 234: rs =
    > Server.CreateObject("ADODB.recordset")
    > Line 235: rs.open(" Select * From tblEvent WHERE
    > date_of_event = '" & currenttime & " ' ", conn, 1, 3)
    > Line 236: 'response.Write(sql1)
    > Line 237:
    >
    >
    > Source File: C:\Documents and Settings\amit\WebSite1\calendar.aspx
    > Line: 235
    >
    > Stack Trace:
    >
    > [COMException (0x80040e07): Data type mismatch in criteria expression.]
    >
    > Microsoft.VisualBasic.CompilerServices.LateBinding.InternalLateCall(Object
    > o, Type objType, String name, Object[] args, String[] paramnames,
    > Boolean[] CopyBack, Boolean IgnoreReturn) +776
    >
    > Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateCall(Object
    > Instance, Type Type, String MemberName, Object[] Arguments, String[]
    > ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack, Boolean
    > IgnoreReturn) +193987
    > ASP.calendar_aspx.__Render__control1(HtmlTextWriter __w, Control
    > parameterContainer) in C:\Documents and
    > Settings\amit\WebSite1\calendar.aspx:235
    > System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer,
    > ICollection children) +98
    > System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +20
    > System.Web.UI.Page.Render(HtmlTextWriter writer) +27
    > System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer,
    > ControlAdapter adapter) +53
    > System.Web.UI.Control.RenderControl(HtmlTextWriter writer,
    > ControlAdapter adapter) +280
    > System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +24
    > System.Web.UI.Page.ProcessRequestMain(Boolean
    > includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    > +8878
    >
    Karl Seguin, Aug 10, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. psychomad
    Replies:
    2
    Views:
    5,202
    Alexey Smirnov
    Apr 10, 2007
  2. Bobby Edward
    Replies:
    1
    Views:
    4,467
    Kevin Spencer
    Mar 5, 2008
  3. Jack
    Replies:
    7
    Views:
    211
  4. Jack
    Replies:
    7
    Views:
    275
  5. programmingzeal
    Replies:
    0
    Views:
    1,114
    programmingzeal
    May 6, 2012
Loading...

Share This Page