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

update checkbox values from gridview to database table.

What do I do to capture the checkbox values as listed below in order to
update the database table. There will be an ID field also contained in the
row to use in the update query. What would I put in the Button Click event?
Thank you. -Greg

<tr>
<td>CO_NUMBER</td><td>
<input id="ItemsGrid_ctl02_CheckBox1" type="checkbox"
name="ItemsGrid$ctl02$CheckBox1" checked="checked" />
</td>
</tr><tr>
<td>CUST_ID</td><td>
<input id="ItemsGrid_ctl03_CheckBox1" type="checkbox"
name="ItemsGrid$ctl03$CheckBox1" />
</td>
</tr>

protected void Button1_Click(object sender, EventArgs e)
{
Request.Form["??????"];
}
May 2 '06 #1
1 3598
Looks like this will give me something to start with;

int loop1;
NameValueCollection coll;
//Load Form variables into NameValueCollection variable.
coll=Request.Form;
// Get names of all forms into a string array.
String[] arr1 = coll.AllKeys;
for (loop1 = 0; loop1 < arr1.Length; loop1++)
{
Response.Write("Form: " + arr1[loop1] + "<br>");

"hazz" <hazz@sonic_net> wrote in message
news:uj**************@TK2MSFTNGP02.phx.gbl...
What do I do to capture the checkbox values as listed below in order to
update the database table. There will be an ID field also contained in the
row to use in the update query. What would I put in the Button Click
event? Thank you. -Greg

<tr>
<td>CO_NUMBER</td><td>
<input id="ItemsGrid_ctl02_CheckBox1" type="checkbox"
name="ItemsGrid$ctl02$CheckBox1" checked="checked" />
</td>
</tr><tr>
<td>CUST_ID</td><td>
<input id="ItemsGrid_ctl03_CheckBox1" type="checkbox"
name="ItemsGrid$ctl03$CheckBox1" />
</td>
</tr>

protected void Button1_Click(object sender, EventArgs e)
{
Request.Form["??????"];
}

May 3 '06 #2

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

Similar topics

2
by: Joe Fetters via .NET 247 | last post by:
Have googled and read the VS.NET documentation can't seem to getthe answer to the following. Environment: Framework 1.1 VB.NET WinForm Access database Using all automagic tools (DataAdapter...
3
by: Michael Glass | last post by:
I'm working on an ASP.Net web app using VS2005 and the .Net 2.0 framework, and I have a serious problem with the page I'm currently working on. The page has, among other things, two FormViews and a...
6
by: Dabbler | last post by:
I have a GridView with a couple of TemplateFields. When I click the update link the Gridview returns to display mode with no errors but the data from bound text fields or dropdown list isn't...
2
by: dba123 | last post by:
How do I take my GridView and create a function that will update -all- checkbox values for the submit button's OnClick event? I have posted both my SQLDataSource and my GridView below: ...
16
by: Ian Davies | last post by:
Hello Needing help with a suitable solution. I have extracted records into a table under three columns 'category', 'comment' and share (the category column also holds the index no of the record...
4
by: =?Utf-8?B?QmFidU1hbg==?= | last post by:
Hi, I have a GridView and a SqlDataSource controls on a page. The SqlDataSource object uses stored procedures to do the CRUD operations. The DataSource has three columns one of which -...
3
by: dhaneshrs | last post by:
I have a gridview i managed to update using the edit option in the smartmenu. The problem comes when i delete a value or make a value read only. Say i have a table Employee with the following...
2
by: sirdavethebrave | last post by:
Hi guys - I have written a form, and a stored procedure to update the said form. It really is as simple as that. A user can go into the form, update some fields and hit the update button to...
4
by: justice750 | last post by:
Hi All, I am using a FormView control. The allows me to update records in the database. However, when a database field is null I can not update the field on the form. It works fine when the field...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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: 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
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.