Datagrid Delete Row (Sad Newbie Q)
Please, please please...
Can somebody tell me simply how to do the Delete Query that allows me to delete just one row based upon a column in the datagrid ? how do I map the parameter in the query to a rown in the datagrid ?
I know I should know but its drivin' me insane !
Thanks
Chubby.
Re: Datagrid Delete Row (Sad Newbie Q)
It should look something like this :
Code:
Dim no As Integer
no = DataGrid1.Item(x, 1)
Dim s As String
con = New SqlConnection("server=200.100.100.100;user id=sa;pwd=hello;database=demo;")
con.Open()
s = "delete products where productid=" & no & ""
cmd = New SqlCommand(s, con)
cmd.ExecuteNonQuery()
End If