Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases 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
  #1 (permalink)  
Old January 25th, 2005, 09:56 PM
Authorized User
 
Join Date: Jan 2005
Location: , , .
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default lost, please help me out...

Compiler Error Message: BC30456: 'Text' is not a member of 'System.Web.UI.HtmlControls.HtmlInputText'.

Source Error:



Line 11: strInsert = "Insert UserSurvey ( FirstName, LastName, PhoneNumber, EmailAddress, ConnectTo, Often, Easy, RecommendToken, PreferAlpha, Rating, Comments, UniqueID ) Values ( @FirstName, @LastName, @PhoneNumber, @EmailAddress, @ConnectTo, @Often, @Easy, @RecommendToken, @PreferAlpha, @Rating, @Comments, @UniqueID )"
Line 12: cmdInsert = New SqlCommand( strInsert, ConTRSS )
Line 13: cmdInsert.Parameters.Add( "@FirstName", txtFirstName.Text )
Line 14: cmdInsert.Parameters.Add( "@LastName", txtLastName.Text)
Line 15: cmdInsert.Parameters.Add( "@PhoneNumber", txtPhoneNumber.Text)
  #2 (permalink)  
Old January 25th, 2005, 10:16 PM
Friend of Wrox
Points: 2,473, Level: 20
Points: 2,473, Level: 20 Points: 2,473, Level: 20 Points: 2,473, Level: 20
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2004
Location: India
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

The textbox used are only html controls, then please modify the code as:

cmdInsert.Parameters.Add( "@FirstName", request.form("txtFirstName"))

same for others too...



Om Prakash
  #3 (permalink)  
Old January 26th, 2005, 11:32 AM
Authorized User
 
Join Date: Jan 2005
Location: , , .
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks man, you really helped me out on that one. Could someone explain why I had that problem? If I ever have that problem again I want to know what I was doing wrong so I don't have to post another message. Was it purely a syntax error on my part?

regards,

Chris

  #4 (permalink)  
Old January 26th, 2005, 02:41 PM
Friend of Wrox
Points: 4,332, Level: 27
Points: 4,332, Level: 27 Points: 4,332, Level: 27 Points: 4,332, Level: 27
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2003
Location: , NJ, USA.
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

   The problem is what om said: You are using HTML controls instead of server controls. So, depending on which type of control you are using, the syntax to obtain the value, as well as others, will be different.
   The syntax you provided would work if your textboxes were server controls.

  #5 (permalink)  
Old January 26th, 2005, 03:01 PM
Authorized User
 
Join Date: Jan 2005
Location: , , .
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks that explained alot, you may have just solved another problem I am having today.

regards,

Chris


Similar Threads
Thread Thread Starter Forum Replies Last Post
Session Value Getting Lost sid81 .NET Framework 2.0 3 October 13th, 2007 10:15 AM
Lost in Css rodmcleay BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 3 May 11th, 2007 05:06 AM
Lost in Chapter 8 pjwarez BOOK: Beginning Mac OS X Programming 2 October 21st, 2006 12:10 PM
Lost in Chapter 2 kyleridolfo BOOK: Expert One-on-One Access Application Development 0 January 5th, 2005 08:01 PM





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