
13/09/2011, 12:55
|
| | Fecha de Ingreso: junio-2011
Mensajes: 329
Antigüedad: 13 años, 8 meses Puntos: 2 | |
Respuesta: checkbox en grid. ok..tengo este codigo :
Dim MyConnection As SqlConnection
Dim comando As New SqlClient.SqlCommand
MyConnection = New SqlConnection("Data Source=DELLMR;Initial Catalog=VENTAS;Persist Security Info=True;User ID=sa;Password=Stm01")
If ASPxGridView1.Selection.Count > 0 Then
Dim KeyValues As List(Of Object) = ASPxGridView1.GetSelectedFieldValues("ocrastreodos ")
Dim sb As StringBuilder = New StringBuilder(KeyValues(0).ToString())
For Each Key As Object In KeyValues
Dim q As String = "DELETE FROM ocrastreodos WHERE oc = '" & Key.ToString & "'"
comando = New SqlCommand(q, MyConnection)
Comando.Connection.Open()
Comando.ExecuteNonQuery()
Comando.Connection.Close()
Next
ASPxGridView1.DataBind()
'CargaGrid()
End If
pero me da este error........
"Object reference not set to an instance of an object"
alguien sabe q ocurre..?..gracias |