I have a Datagridview
and is Filled with values with one column having check box.
The requirement is that only that row will be saved on save button click,
which is checked.
If first row is checked then only first row will be saved in database.
and if all rows are checked then all rows will saved.
I have tried this ,to save all the rows.
With MyCommand
For Each row As DataGridViewRow In dgv.Rows
MyParam(0) = CreateParam("@ReturnValue", SqlDbType.Int, ParameterDirection.ReturnValue, 0, 0)
MyParam(0) = CreateParam("@TID", SqlDbType.Int, ParameterDirection.Input, 4, lblTID.Text)
MyParam(1) = CreateParam("@SlNo", SqlDbType.Int, ParameterDirection.Input, 4, row.Cells(0).Value)
.Parameters.Clear()
Dim i As Integer
For i = 0 To 1
.Parameters.Insert(i, MyParam(i))
Next
.CommandText = "SPIS_UpdateItemTransDtl"
MyConnection.ExecuteCommand(MyCommand)
Next
lngErrorCode = CInt(.Parameters(0).Value)
If lngErrorCode < 0 Then
sbErrorMsg(lngErrorCode)
Else
MsgBox("Record Saved Successfully !")
End If
End With
how can I save only the Checked Rows.
Assist