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

FW: How to do a multiple select and update in a datagrid

P: n/a

From: "Wolffang" <ja***@techlite.co.uk>
Subject: How to do a multiple select and update in a datagrid
Date: 23 October 2004 21:28

Using Visual studio.net VB

I have a datagrid that brings records from a stored procedure.

Be selecting multiple datarows using a checkbox.
All i want to do is update a field called 'Active' datatype bit from 0 to 1
for all those records that have been selected with the checkbox and mark
another field 'User' with the name of the user who selected these items when
a update button is clicked.

checkbox needs to be disabled if the record of 'Active' is 1

multiselect will be done using the article...
http://www.codeproject.com/aspnet/Mu...Dataagrid.asp?

any solutions out there???

Nov 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
I have a datagrid that has a checkbox...

when a checkboxes are clicked, i am updating the records that are checked...

This is what i have so far.... but i am geting an error.... where the
OrderID is not being passed from the datagrid "dgOrders" to the stored
procedure... but the checkbox is working... is this because i am using
FindControl???

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click

Dim dg As DataGridItem

Dim ck As CheckBox

Dim OrdID As Label

Me.SqlConnection1.Open()

For Each dg In dgOrders.Items

ck = dg.FindControl("chkSelect")

OrdID = dg.FindControl("OrderID")

If ck.Checked = True Then

Me.SqlCommand1.Parameters("@OrderID").Value = OrdID

Me.SqlCommand1.Parameters("@AdminUserName").Value = lblUserName.Text

Me.SqlCommand1.Parameters("@AdminProcess").Value = 1

Me.SqlCommand1.ExecuteNonQuery()

End If

Next

Me.SqlConnection1.Close()

End Sub



"Wolffang" <ja***@techlite.co.uk> wrote in message
news:mY********************@pipex.net...

From: "Wolffang" <ja***@techlite.co.uk>
Subject: How to do a multiple select and update in a datagrid
Date: 23 October 2004 21:28

Using Visual studio.net VB

I have a datagrid that brings records from a stored procedure.

Be selecting multiple datarows using a checkbox.
All i want to do is update a field called 'Active' datatype bit from 0 to
1
for all those records that have been selected with the checkbox and mark
another field 'User' with the name of the user who selected these items
when
a update button is clicked.

checkbox needs to be disabled if the record of 'Active' is 1

multiselect will be done using the article...
http://www.codeproject.com/aspnet/Mu...Dataagrid.asp?

any solutions out there???

Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.