473,394 Members | 1,852 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Reading values from multiple "similar" controls

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
1 1072
> 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Calan | last post by:
I have a server-side ASP script that dynamically creates an input form from a database table. The table contains a field name, the table where values are stored, type of input control, value for a...
7
by: Eric Laberge | last post by:
Aloha! This question is meant to be about C99 and unnamed compound objects. As I read, if such a construct as int *p = (int){0}; is used within a function, then it has "automatic storage...
4
by: darrel | last post by:
Karl has helped me in the past in regards to communicating between controls and pages: http://www.openmymind.net/communication/index.html#3.1 I ended up going down the interfaces path and...
1
by: Craig | last post by:
I'm planning on persisting sessionState in a database (not MS SQL). Is there a way to do this using the web.config file? I see that you can set the sessionState mode="SQLServer" to persist to a...
6
by: Richard Brown | last post by:
Ok, I celebrate and rejoice in the Anchor property. So wonderful compared to the horrible 'resize' code I had to write in VB6, there is just no end to the wonders of VB.NET..... uh, ok..... BUT......
0
by: Piotr | last post by:
'I think that best operator for text strings is '..."." { int method() { return 0; } } ' abc...
1
by: dwainew | last post by:
Problem: I'd like to archive off the contents of a text file. However, other processes may have the file open, so MoveTo(newfilepath) can't be done, as far as I've found. Start with a 5 MB...
1
by: DCC700 | last post by:
After upgrading a web application from VS 2003 to 2005 there is a page where any control event that should cause a postback instead generates an Invalid character error on the page. For example a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.