hi im using vb.net i need help to delete all rows from ultragrid
the coding is different from the datagrid
any one has any ideas
i have this code but in datagrid but i want ultragrid
coz ultragrid1.item(x,1) doesnt exist
Try
Dim dt As DataTable
dt = Me.Orderdetailds1.Tables("Product")
For x As Integer = 0 To Orderdetailds1.Tables("Product").Rows.Count - 1
If DataGrid1.Item(x, 0) = False Then
Else
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
Next