By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,037 Members | 1,839 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,037 IT Pros & Developers. It's quick & easy.

Reading values from multiple "similar" controls

P: n/a
I have a form with mutiple text fields, all of similar nature.. for
example:

userName1, location1
userName2, location2
..
..
..
userName10, location10

all are text fields. while reading the input and saving to a database,
I'd like to be able to read all of them in a single loop and issue the
appropriate SQL commands. In ASP 3.0 I can do the following:

for i = 1 to 10
sql = "INSERT into TABLE VALUES ('" & Request.Form("userName" & count)
& "','" & Request.Form("location" & count) & "')"
execute sql stmt
next

How would i go about doing this in ASP.NET? I am not using the Request
object. I am using an event trigger (button clicked) to gather the info
and save to a database.

Bijoy

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
> for i = 1 to 10
sql = "INSERT into TABLE VALUES ('" & Request.Form("userName" & count)
& "','" & Request.Form("location" & count) & "')"
execute sql stmt
next


Your classic ASP implementation will work for ASP.NET. (Most likely you
will need to modify the syntax a bit)

--
Peter O'Reilly
Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.