469,646 Members | 1,161 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,646 developers. It's quick & easy.

dynamically creating textboxes based on sql records

Is there a recommended way to have a form that is a list of textboxes from
a sql table based on a username that then puts the captured data back into
the db?

I have a table |userid|skill|level|. I need to display the list to the
user, have them update the level and then store this data back into the
table. I can't seem to create the textboxes as asp controls with a unique
id based on the text in the skill field.(to enable me to put the data back
into the database)

thanks for any help or pointers

tony
Nov 18 '05 #1
10 1805
Tony,

Why not to use datagrid? You can make template columns containing textboxes.

Eliyahu

"Tony" <tony@Wright_nospam_one.co.uk> wrote in message
news:pan.2004.06.26.08.39.17.609079@Wright_nospam_ one.co.uk...
Is there a recommended way to have a form that is a list of textboxes from
a sql table based on a username that then puts the captured data back into
the db?

I have a table |userid|skill|level|. I need to display the list to the
user, have them update the level and then store this data back into the
table. I can't seem to create the textboxes as asp controls with a unique
id based on the text in the skill field.(to enable me to put the data back
into the database)

thanks for any help or pointers

tony

Nov 18 '05 #2
On Sun, 27 Jun 2004 11:27:55 +0200, Eliyahu Goldin wrote:
Tony,

Why not to use datagrid? You can make template columns containing
textboxes.

Eliyahu


Hi, can you tell me where to find a good tutorial on templates? I have had
a look at a few but nothing for the beginner. Do any show how to access
the textbox on a post back when the id is not known(Created dynamically)?

Thanks

Tony
Nov 18 '05 #3
Tony,

I don't know much about tutorials, sorry. As to id, it is known. Look at
UniqueId property. It is made specially for your purposes.

Eliyahu

"Tony" <tony@Wright_nospam_one.co.uk> wrote in message
news:pan.2004.06.27.09.10.57.706667@Wright_nospam_ one.co.uk...
On Sun, 27 Jun 2004 11:27:55 +0200, Eliyahu Goldin wrote:
Tony,

Why not to use datagrid? You can make template columns containing
textboxes.

Eliyahu


Hi, can you tell me where to find a good tutorial on templates? I have had
a look at a few but nothing for the beginner. Do any show how to access
the textbox on a post back when the id is not known(Created dynamically)?

Thanks

Tony

Nov 18 '05 #4
Tony,

Why not to use datagrid? You can make template columns containing textboxes.

Eliyahu

"Tony" <tony@Wright_nospam_one.co.uk> wrote in message
news:pan.2004.06.26.08.39.17.609079@Wright_nospam_ one.co.uk...
Is there a recommended way to have a form that is a list of textboxes from
a sql table based on a username that then puts the captured data back into
the db?

I have a table |userid|skill|level|. I need to display the list to the
user, have them update the level and then store this data back into the
table. I can't seem to create the textboxes as asp controls with a unique
id based on the text in the skill field.(to enable me to put the data back
into the database)

thanks for any help or pointers

tony

Nov 18 '05 #5
On Sun, 27 Jun 2004 11:27:55 +0200, Eliyahu Goldin wrote:
Tony,

Why not to use datagrid? You can make template columns containing
textboxes.

Eliyahu


Hi, can you tell me where to find a good tutorial on templates? I have had
a look at a few but nothing for the beginner. Do any show how to access
the textbox on a post back when the id is not known(Created dynamically)?

Thanks

Tony
Nov 18 '05 #6
Tony,

I don't know much about tutorials, sorry. As to id, it is known. Look at
UniqueId property. It is made specially for your purposes.

Eliyahu

"Tony" <tony@Wright_nospam_one.co.uk> wrote in message
news:pan.2004.06.27.09.10.57.706667@Wright_nospam_ one.co.uk...
On Sun, 27 Jun 2004 11:27:55 +0200, Eliyahu Goldin wrote:
Tony,

Why not to use datagrid? You can make template columns containing
textboxes.

Eliyahu


Hi, can you tell me where to find a good tutorial on templates? I have had
a look at a few but nothing for the beginner. Do any show how to access
the textbox on a post back when the id is not known(Created dynamically)?

Thanks

Tony

Nov 18 '05 #7
On Sun, 27 Jun 2004 10:10:58 +0100, Tony
<tony@Wright_nospam_one.co.uk> wrote:
On Sun, 27 Jun 2004 11:27:55 +0200, Eliyahu Goldin wrote:
Tony,

Why not to use datagrid? You can make template columns containing
textboxes.

Eliyahu


Hi, can you tell me where to find a good tutorial on templates? I have had
a look at a few but nothing for the beginner. Do any show how to access
the textbox on a post back when the id is not known(Created dynamically)?


Think again about the "not known" comment. Something had to be used to
determine which text boxes were to be created. That same code should
be used again to get the text boxes and their contents.

Nov 18 '05 #8
Tony.... You just need to persist the primary key for the row "in" the
HTML
page. So first you must get the primary key for the row and then you
must
decided how to "persist" the value into the page (using viewstate,
session,
hidden field). If the primary key is the person's name you could have
problems if two people have the same name. If this is confusing, you
could
read up on the terms candidate key, primary key, simple key and compound
key.

Regards,
Jeff
I can't seem to create the textboxes as asp controls with a unique

id based on the text in the skill field.(to enable me to put the data
back
into the database)<
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #9
On Sun, 27 Jun 2004 10:10:58 +0100, Tony
<tony@Wright_nospam_one.co.uk> wrote:
On Sun, 27 Jun 2004 11:27:55 +0200, Eliyahu Goldin wrote:
Tony,

Why not to use datagrid? You can make template columns containing
textboxes.

Eliyahu


Hi, can you tell me where to find a good tutorial on templates? I have had
a look at a few but nothing for the beginner. Do any show how to access
the textbox on a post back when the id is not known(Created dynamically)?


Think again about the "not known" comment. Something had to be used to
determine which text boxes were to be created. That same code should
be used again to get the text boxes and their contents.

Nov 18 '05 #10
Tony.... You just need to persist the primary key for the row "in" the
HTML
page. So first you must get the primary key for the row and then you
must
decided how to "persist" the value into the page (using viewstate,
session,
hidden field). If the primary key is the person's name you could have
problems if two people have the same name. If this is confusing, you
could
read up on the terms candidate key, primary key, simple key and compound
key.

Regards,
Jeff
I can't seem to create the textboxes as asp controls with a unique

id based on the text in the skill field.(to enable me to put the data
back
into the database)<
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #11

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Bhavin | last post: by
2 posts views Thread by Briand | last post: by
9 posts views Thread by netasp | last post: by
6 posts views Thread by Bjorn Sagbakken | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.