PRAISE PHS
Well-known member
- Joined
- Jun 2, 2011
- Messages
- 58
- Programming Experience
- Beginner
Hi All,
Pls, kindly help me with this:
I fill two different datagridview with items on my app. But when I try to clear the gridview by using dataset.clear, one of the gridview is cleared while the second gridview remains uncleared. How do I clear the two grids simultaneously by using a dataset. Below are the code I used to populate the grids.
Pls, kindly help me with this:
I fill two different datagridview with items on my app. But when I try to clear the gridview by using dataset.clear, one of the gridview is cleared while the second gridview remains uncleared. How do I clear the two grids simultaneously by using a dataset. Below are the code I used to populate the grids.
VB.NET:
Private Sub btnGoodPart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGoodPart.Click
Adapter = New SqlDataAdapter("SELECT PartName FROM PartDetails WHERE Condition = 1 AND MachineID = '" & Integer.Parse(arst) & "'", MyConn)
scb = New SqlCommandBuilder
ds = New DataSet
Adapter.Fill(ds, "PartDetails")
DataGridViewGood.DataSource = ds
DataGridViewGood.DataMember = ("PartDetails")
End Sub
Private Sub btnBadPart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBadPart.Click
Adapter = New SqlDataAdapter("SELECT PartName FROM PartDetails WHERE Condition = 0 AND MachineID = '" & Integer.Parse(arst) & "'", MyConn)
scb = New SqlCommandBuilder
ds = New DataSet
Adapter.Fill(ds, "PartDetails")
DataGridViewBad.DataSource = ds
DataGridViewBad.DataMember = ("PartDetails")
End Sub