473,378 Members | 1,346 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,378 software developers and data experts.

Rowcount of a table

Hi all, i have two questions

1) I have an asp page where the user clicks on an add button which adds rows
to the HTML table. When the user clicks on the submit button the same form
is posted again. How do i know how many rows the user added to the table. I
can get it in the script tag but i need to do this in the <%%> tag. I have
to get these values and insert into the database. All the controls created
dynamically are named volume1, volume2 etc.,

2) Since i have to go through the loop and insert the rows from the table
mentioned above, is there any way to write a generic insert statement. The
below code shows what i am trying to do.

volume1 = Request.Form("volume1text")
volume2 = Request.Form("volume2text")
volume3 = Request.Form("volume3text")

For i = 1 to 3
If i = 1 Then
"Insert into table values (" & volume1 & ")"
Elseif i = 2 Then
"Insert into table values (" & volume2 & ")"
Else
"Insert into table values (" & volume3 & ")"
Next

What i want to do is write something like the following. How can i do this.
The following variablr volInsert is being treated as string. Volume is a
text field.

For i = 1 to 3
volInsert = "volume" & i
"Insert into table values ('" & volInsert & "')"
Next

Thanks
Jul 19 '05 #1
3 1599
When the user clicks the submit button to create the row's, are you passing
the rows to create, to a querystring? if not, give that a try (works for
me).

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!
"HoustonLucifer" <ho************@sbcglobal.net> wrote in message
news:bu******************@newssvr24.news.prodigy.c om...
Hi all, i have two questions

1) I have an asp page where the user clicks on an add button which adds rows to the HTML table. When the user clicks on the submit button the same form
is posted again. How do i know how many rows the user added to the table. I can get it in the script tag but i need to do this in the <%%> tag. I have
to get these values and insert into the database. All the controls created
dynamically are named volume1, volume2 etc.,

2) Since i have to go through the loop and insert the rows from the table
mentioned above, is there any way to write a generic insert statement. The
below code shows what i am trying to do.

volume1 = Request.Form("volume1text")
volume2 = Request.Form("volume2text")
volume3 = Request.Form("volume3text")

For i = 1 to 3
If i = 1 Then
"Insert into table values (" & volume1 & ")"
Elseif i = 2 Then
"Insert into table values (" & volume2 & ")"
Else
"Insert into table values (" & volume3 & ")"
Next

What i want to do is write something like the following. How can i do this. The following variablr volInsert is being treated as string. Volume is a
text field.

For i = 1 to 3
volInsert = "volume" & i
"Insert into table values ('" & volInsert & "')"
Next

Thanks

Jul 19 '05 #2
Actually i use the VB Script to add the rows in the table

<script>
Set row = form1.Table1.InsertRow()
Set cell = row.InsertCell()
</script>

"Steven Burn" <pv*@noyb.com> wrote in message
news:eg**************@TK2MSFTNGP10.phx.gbl...
When the user clicks the submit button to create the row's, are you passing the rows to create, to a querystring? if not, give that a try (works for
me).

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!
"HoustonLucifer" <ho************@sbcglobal.net> wrote in message
news:bu******************@newssvr24.news.prodigy.c om...
Hi all, i have two questions

1) I have an asp page where the user clicks on an add button which adds rows
to the HTML table. When the user clicks on the submit button the same form is posted again. How do i know how many rows the user added to the table. I
can get it in the script tag but i need to do this in the <%%> tag. I

have to get these values and insert into the database. All the controls created dynamically are named volume1, volume2 etc.,

2) Since i have to go through the loop and insert the rows from the table mentioned above, is there any way to write a generic insert statement. The below code shows what i am trying to do.

volume1 = Request.Form("volume1text")
volume2 = Request.Form("volume2text")
volume3 = Request.Form("volume3text")

For i = 1 to 3
If i = 1 Then
"Insert into table values (" & volume1 & ")"
Elseif i = 2 Then
"Insert into table values (" & volume2 & ")"
Else
"Insert into table values (" & volume3 & ")"
Next

What i want to do is write something like the following. How can i do

this.
The following variablr volInsert is being treated as string. Volume is a
text field.

For i = 1 to 3
volInsert = "volume" & i
"Insert into table values ('" & volInsert & "')"
Next

Thanks


Jul 19 '05 #3
> Actually i use the VB Script to add the rows in the table

<script>
Set row = form1.Table1.InsertRow()
Set cell = row.InsertCell()
</script>


THis is on the clientside? So have a counter. Every time you call
InsertRow(), add 1 to the counter. WHat does this have to do with ASP
again?
Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: MissLivvy | last post by:
What's the difference between the rowcount column returned by: DBCC SHOW_STATISTICS('table_name','primarykey') and SELECT rows FROM sysindexes WHERE id = OBJECT_ID('table_name') AND indid <...
1
by: Papri Chakravorty | last post by:
hello i have been trying to connect to a table an error keeps coming up in html that the total rows is less than total row count also an error in the datagrid, that the index number is not same as...
2
by: louis | last post by:
When I need to perform an update against multi-million row table I typically specify @@rowcount, to reduce locks. e.g. set @@rowcount 1000 while exists (select * from myTable where col2 is...
5
by: wackyphill | last post by:
Is Set RowCount @RowCount More efficient than simply using TOP? Thanks for any input.
3
by: Dimitri Furman | last post by:
SQL Server 2000 SP3. Is it possible for the @@ROWCOUNT function to return NULL after a statement? I am troubleshooting a relatively large stored procedure with multiple SELECT statements and a...
4
by: Richard G | last post by:
I'm a database guy, so go easy on me here. :) How can I get the rowcount of the affected rows of a SQL statement from a stored procedure call? I know that "set nocount on" does not return the...
0
by: robert madrian | last post by:
Hello, I have created a Dataset with a TabelAdapter to call as tored procedure to retrieve records from a SQLServer DB. In a aspx Site I use a GridView and the ObjectDataSource to display the...
1
by: sandeepk84 | last post by:
hi all... can anyone tell me how we can use rowcount to delete some rows from a table.. means, i have some rows in d table. and i have to delete some rows (from beginning) based on some...
2
ck9663
by: ck9663 | last post by:
i found the sys.partition view. i can access it if i am in the same database. if i am in a different database, it does not allow me to do a db.owner.sys.partition form of reference. am just trying...
3
by: Andrus | last post by:
I have DataGridView in virtual mode containing 3500 rows. In code below, assigning to RowCount value to 3500 takes 8 seconds. CPU usage goes high at this time. Stepping by F11 into user code shows...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.