Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > BOOK: Beginning ASP.NET 1.0
|
BOOK: Beginning ASP.NET 1.0
This is the forum to discuss the Wrox book Beginning ASP.NET 1.0 with C# by Chris Goode, John Kauffman, Christopher L. Miller, Neil Raybould, S. Srinivasa Sivakumar, Dave Sussman, Ollie Cornes, Rob Birdwell, Matt Butler, Gary Johnson, Ajoy Krishnamoorthy, Juan T. Llibre, Chris Ullman; ISBN: 9780764543708
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 1.0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 25th, 2004, 05:32 PM
Authorized User
 
Join Date: Jul 2004
Posts: 71
Thanks: 0
Thanked 0 Times in 0 Posts
Default Data type mismatch in criteria expression

Below is my code for an edit form page that I am working on:

-----------------
Imports System.Data
Imports System.Data.OleDb
Imports System.Web

Public Class EditUserAccount
    Inherits System.Web.UI.Page

#Region " Web Form Designer Generated Code "

    'This call is required by the Web Form Designer.
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

    End Sub

    Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
        'CODEGEN: This method call is required by the Web Form Designer
        'Do not modify it using the code editor.
        InitializeComponent()
    End Sub

#End Region

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        'see if user is logged in
        If Session("IsLoggedIn") = False Then
            Response.Redirect("frmLogin2.aspx")
        End If

        'Dim variables and objects
        Dim objUser As New clsUser()
        Dim objDBComm As OleDbCommand
        Dim objDBConn As OleDbConnection
        Dim intID As Int16
        Dim strName, strAddress As String

        Dim strSQL As String

        'setup database connection
        Dim objGetConnection As New clsDBConnection()
        objDBConn = objGetConnection.GetDatabaseConnection

        'setup SQL string
        strSQL = "SELECT UserID, Name, Address, City, Province, PostalCode, Username, [Password] FROM [User] WHERE UserID = '2'"




        Dim objDR As OleDbDataReader
        Dim Cmd As New OleDbCommand(strSQL, objDBConn)
        objDR = Cmd.ExecuteReader(System.Data.CommandBehavior.Clos eConnection) While objDR.Read()
            intID = objDR("UserID")
            strName = objDR("Name")
            strAddress = objDR("Address")
        End While
        Page.DataBind()


    'load form textboxes with selected data from database
        Request.Form("txtname") = strName
        Request.Form("txtaddress") = strAddress


    End Sub

End Class
------------------------

I get the following error on the above red line:
----
Data type mismatch in criteria expression
----

Anyone know the casue &/or solution.

Thanks,
Mark







Similar Threads
Thread Thread Starter Forum Replies Last Post
data type mismatch in criteria expression coreyjustin Classic ASP Basics 1 December 10th, 2007 06:49 PM
Data type mismatch in criteria expression Tawanda BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 0 May 5th, 2007 05:29 PM
Data type mismatch in criteria expression. imercha Classic ASP Basics 3 November 23rd, 2006 11:09 AM
Data type mismatch in criteria expression. EDEN Access ASP 1 November 22nd, 2006 01:19 AM
Data type mismatch in criteria expression. kalchev ASP.NET 2.0 Professional 5 April 11th, 2006 11:08 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.