dcsimg
www.webdeveloper.com
Results 1 to 3 of 3

Thread: Another day..Another Error..System.UI.WebControls.Textbox

  1. #1
    Join Date
    Feb 2003
    Location
    Sault Ste Marie, On, Canada
    Posts
    168

    Another day..Another Error..System.UI.WebControls.Textbox

    This is the error message:
    Value of type 'String' cannot be converted to 'System.Web.UI.WebControls.TextBox'.

    Error Line:
    Page_First_Name = request.Form("Page_First_Name")

    I think another error causing it may be because of some of this code I'm using..Thx In Advance.

    Sub Find_Deceased(sender As Object, e As EventArgs)
    Dim connectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0; Ole DB Services=-4; Data Source=C:\Profiles\Dat"& _
    "abases\Profiles.mdb"
    Dim dbConnection As System.Data.IDbConnection = New System.Data.OleDb.OleDbConnection(connectionString)

    Page_First_Name = request.Form("Page_First_Name")

    Dim queryString As String = "SELECT [Profiles].[First_Name], [Profiles].[Last_Name], [Profiles].[Birth_Date], "& _
    "[Profiles].[About_Deceased], [Profiles].[Birth_Place] FROM [Profiles] WHERE ([Pr"& _
    "ofiles].[First_Name] = @Page_First_Name)"
    Dim dbCommand As System.Data.IDbCommand = New System.Data.OleDb.OleDbCommand
    dbCommand.CommandText = queryString
    dbCommand.Connection = dbConnection

    Dim dbParam_page_First_Name As System.Data.IDataParameter = New System.Data.OleDb.OleDbParameter
    dbParam_page_First_Name.ParameterName = "Page_First_Name"
    dbParam_page_First_Name.Value = page_First_Name
    dbParam_page_First_Name.DbType = System.Data.DbType.String
    dbCommand.Parameters.Add(dbParam_page_First_Name)

    Dim dataAdapter As System.Data.IDbDataAdapter = New System.Data.OleDb.OleDbDataAdapter
    dataAdapter.SelectCommand = dbCommand
    Dim dataSet As System.Data.DataSet = New System.Data.DataSet
    dataAdapter.Fill(dataSet)
    response.write("You")

    If queryString = "" Then
    response.redirect("No_User.aspx")
    End If

    ' Return dataSet
    End Sub

  2. #2
    Join Date
    Jan 2004
    Location
    Melbourne, Australia
    Posts
    5,298
    Moved to .NET forum.

  3. #3
    Join Date
    Nov 2002
    Location
    Auburn, AL
    Posts
    9,222
    whats up with the sql statement
    select [profiles].[something]
    that is really unneccessary.

    Try renaming the string to pagefirstname and just keep it separate from what you are requesting from the form, the text box. See what it does.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles