J
Jackmac
Hi all,
Hopefully someone can offer some advice. I've got a form with two data
grids on it. One has names of boxes in it, the other grid has contents of
the boxes. I want to click on a box in grid 'A' and the contents show in
box 'B'. At present it shows the contents of any box I click on. When I go
to another box, it shows the contents for that box. If I go back to any
choice I've made already, it crashes out. Any ideas? The code I'm using is
shown below:
Dim ws_BoxID As String
ws_BoxID = BoxGrid.Rows(BoxGrid.CurrentCell.RowIndex).Cells(0).Value
Dim ws_SQL As String = "SELECT * FROM BoxContent WHERE BoxID = '" & ws_BoxID
& "'"
Debug.Print(ws_SQL)
Dim myDataTable As DataTable
myDataTable = GetDataTableADONET(ws_SQL)
BoxInfoGrid.DataSource = myDataTable
DataGridView1.DataSource = myDataTable
Hopefully someone can offer some advice. I've got a form with two data
grids on it. One has names of boxes in it, the other grid has contents of
the boxes. I want to click on a box in grid 'A' and the contents show in
box 'B'. At present it shows the contents of any box I click on. When I go
to another box, it shows the contents for that box. If I go back to any
choice I've made already, it crashes out. Any ideas? The code I'm using is
shown below:
Dim ws_BoxID As String
ws_BoxID = BoxGrid.Rows(BoxGrid.CurrentCell.RowIndex).Cells(0).Value
Dim ws_SQL As String = "SELECT * FROM BoxContent WHERE BoxID = '" & ws_BoxID
& "'"
Debug.Print(ws_SQL)
Dim myDataTable As DataTable
myDataTable = GetDataTableADONET(ws_SQL)
BoxInfoGrid.DataSource = myDataTable
DataGridView1.DataSource = myDataTable