Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Reading values from multiple "similar" controls

Reply
Thread Tools

Reading values from multiple "similar" controls

 
 
Bijoy Naick
Guest
Posts: n/a
 
      05-04-2004
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!
 
Reply With Quote
 
 
 
 
Peter O'Reilly
Guest
Posts: n/a
 
      05-04-2004
> 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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Reading multiple values from resource.resx Mike ASP .Net 0 06-05-2009 04:09 PM
Re: Reading Multiple Values from List using JSP and Form Post Method Lew Java 0 02-09-2008 08:57 PM
Reading values of anonymous controls KasperBirch@gmail.com ASP .Net 1 03-29-2006 02:30 PM
Reading Values of Datagrid Controls DaDev ASP .Net Datagrid Control 0 06-24-2004 08:52 AM
reading values between custom controls MaverickAmit ASP .Net Web Controls 1 10-02-2003 07:52 AM



Advertisments