Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > data type mismatch error

Reply
Thread Tools

data type mismatch error

 
 
amitbadgi@gmail.com
Guest
Posts: n/a
 
      08-10-2005
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.NewLateBind ing.LateCall(Object
Instance, Type Type, String MemberName, Object[] Arguments, String[]
ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack, Boolean
IgnoreReturn) +193987
ASP.calendar_aspx.__Render__control1(HtmlTextWrite r __w, Control
parameterContainer) in C:\Documents and
Settings\amit\WebSite1\calendar.aspx:235
System.Web.UI.Control.RenderChildrenInternal(HtmlT extWriter writer,
ICollection children) +98
System.Web.UI.Control.RenderChildren(HtmlTextWrite r writer) +20
System.Web.UI.Page.Render(HtmlTextWriter writer) +27
System.Web.UI.Control.RenderControlInternal(HtmlTe xtWriter 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

 
Reply With Quote
 
 
 
 
Karl Seguin
Guest
Posts: n/a
 
      08-10-2005
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!)
<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> 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.NewLateBind ing.LateCall(Object
> Instance, Type Type, String MemberName, Object[] Arguments, String[]
> ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack, Boolean
> IgnoreReturn) +193987
> ASP.calendar_aspx.__Render__control1(HtmlTextWrite r __w, Control
> parameterContainer) in C:\Documents and
> Settings\amit\WebSite1\calendar.aspx:235
> System.Web.UI.Control.RenderChildrenInternal(HtmlT extWriter writer,
> ICollection children) +98
> System.Web.UI.Control.RenderChildren(HtmlTextWrite r writer) +20
> System.Web.UI.Page.Render(HtmlTextWriter writer) +27
> System.Web.UI.Control.RenderControlInternal(HtmlTe xtWriter 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
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
VHDL Type Mismatch error indexed name returns a value whose type does not match programmingzeal VHDL 0 05-06-2012 06:38 AM
OleDbException: Data type mismatch in criteria expression. Bobby Edward ASP .Net 1 03-05-2008 01:17 PM
System.Data.OleDb.OleDbException: Data type mismatch in criteria expression. psychomad ASP .Net 2 04-10-2007 07:31 PM
Error: Data type mismatch in criteria expression Jack ASP General 7 01-04-2005 05:25 PM
Error in dynamic sql: Data type mismatch in criteria Jack ASP General 7 12-28-2004 04:09 AM



Advertisments