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(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button2.Click
Dim dg As DataGridItem
Dim ck As CheckBox
Dim OrdID As Label
Me.SqlConnectio n1.Open()
For Each dg In dgOrders.Items
ck = dg.FindControl( "chkSelect" )
OrdID = dg.FindControl( "OrderID")
If ck.Checked = True Then
Me.SqlCommand1. Parameters("@Or derID").Value = OrdID
Me.SqlCommand1. Parameters("@Ad minUserName").V alue = lblUserName.Tex t
Me.SqlCommand1. Parameters("@Ad minProcess").Va lue = 1
Me.SqlCommand1. ExecuteNonQuery ()
End If
Next
Me.SqlConnectio n1.Close()
End Sub
"Wolffang" <ja***@techlite .co.uk> wrote in message
news:mY******** ************@pi pex.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???