Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
| Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics 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 March 29th, 2007, 09:29 AM
Registered User
 
Join Date: Mar 2007
Location: , , India.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to chandra_yvr
Default About dynamic textboxes data capturing

Hi,
I developed a code for dynamic insertion of textboxes on the webpage using vb.net.But i don't know how to insert the dynamic textboxes data into database .I am using placeholder for dynamic textboxes.
cmd.commandtext="insert into test values("what should i write here")

 
Old March 29th, 2007, 10:17 AM
Friend of Wrox
Points: 7,395, Level: 36
Points: 7,395, Level: 36 Points: 7,395, Level: 36 Points: 7,395, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

hi there..

cmd.commandtext="insert into test values(" & yourtextboxname.text & "," & othertextboxname.text & ")

and so on... remember that in the insert command you have to surround text with ' and dates depending your database...

HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
WORKS ON MY MACHINE
http://www.codinghorror.com/blog/archives/000818.html
================================================== =========
 
Old March 29th, 2007, 10:28 AM
Registered User
 
Join Date: Mar 2007
Location: , , India.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to chandra_yvr
Default

Hi thanks for ur reply but my problem is not solved.
Because textboxes are inserted in webpage dynamically based on button click.So statically i am not placing textboxes.i am using placeholders for dynamic insertion of textboxes.

Quote:
quote:Originally posted by gbianchi
 hi there..

cmd.commandtext="insert into test values(" & yourtextboxname.text & "," & othertextboxname.text & ")

and so on... remember that in the insert command you have to surround text with ' and dates depending your database...

HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
WORKS ON MY MACHINE
http://www.codinghorror.com/blog/archives/000818.html
================================================== =========
 
Old March 29th, 2007, 10:38 AM
Friend of Wrox
Points: 7,395, Level: 36
Points: 7,395, Level: 36 Points: 7,395, Level: 36 Points: 7,395, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

you are right.. my mistake..

you have to do a findcontrol on your page that returns every textbox and add that textbox (using a little modified code, but the same idea as before)...

findcontrol will take an id (witch you have to put on your textbox when you add it to the page) and will return and object if it can find it. Then ctype that object to the textbox and you are ready...



HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
WORKS ON MY MACHINE
http://www.codinghorror.com/blog/archives/000818.html
================================================== =========
 
Old March 30th, 2007, 12:31 AM
Registered User
 
Join Date: Mar 2007
Location: , , India.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to chandra_yvr
Default

Thank U sir,
But i am not getting clear idea.
this textbox takes only numerics

dim tb as textbox
tb=placeholder1.findcontrol("what abt id :")
what should i write in insert command
cmd.commandtext="insert into test values("tb.text")


Quote:
quote:Originally posted by gbianchi
 you are right.. my mistake..

you have to do a findcontrol on your page that returns every textbox and add that textbox (using a little modified code, but the same idea as before)...

findcontrol will take an id (witch you have to put on your textbox when you add it to the page) and will return and object if it can find it. Then ctype that object to the textbox and you are ready...



HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
WORKS ON MY MACHINE
http://www.codinghorror.com/blog/archives/000818.html
================================================== =========
 
Old March 30th, 2007, 09:58 AM
Friend of Wrox
Points: 7,395, Level: 36
Points: 7,395, Level: 36 Points: 7,395, Level: 36 Points: 7,395, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

little example:
Code:
dim tb as textbox
tb=placeholder1.findcontrol([b]your textbox.id(in doble quotes)[b])
cmd.commandtext="insert into test values(" & tb.text & ")
now you see it??


HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
WORKS ON MY MACHINE
http://www.codinghorror.com/blog/archives/000818.html
================================================== =========




Similar Threads
Thread Thread Starter Forum Replies Last Post
Get all user data from ALL dynamic textboxes feffe VB How-To 3 May 31st, 2007 07:03 AM
creating dynamic textboxes djricochet ASP.NET 2.0 Professional 0 March 14th, 2006 12:04 PM
Capturing MSHFlexGrid Data davekrunal46 VB How-To 2 November 30th, 2005 03:00 AM
capturing asp data in clientside javascript Terry Joseph Migliorino Javascript How-To 9 November 2nd, 2005 09:10 AM
capturing asp data in clientside javascript Terry Joseph Migliorino Javascript 1 October 31st, 2005 01:42 PM





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