it's quite a simple code to load the data into the datagridview:
it works perfect when I call it on form load....
but then after some data changed in the SQL and repeat the routine, the table doesn't show any row. The columns are there, but the rows disappear.
if I allow the col.SortMode for the user to sort... and then click on the columns.. the data appear...
I already tried to put a .Refresh there and nothing changed....
any suggestions???
VB.NET:
If Not db.Query("SELECT id as 'ID', name as 'Name' FROM subsidiary", ds.Tables("subsidiary")) Then
MessageBox.Show(db.ErrorMessage, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
btn_Go.Enabled = False
Return
End If
With tbl_subsidiary
.DataSource = ds.Tables("subsidiary")
.ReadOnly = True
.AutoResizeColumns()
.RowHeadersVisible = False
.Columns("Name").Width = .Width - .Columns("Id").Width - 5
For Each col As DataGridViewColumn In .Columns
col.SortMode = DataGridViewColumnSortMode.NotSortable
Next
End With
it works perfect when I call it on form load....
but then after some data changed in the SQL and repeat the routine, the table doesn't show any row. The columns are there, but the rows disappear.
if I allow the col.SortMode for the user to sort... and then click on the columns.. the data appear...
I already tried to put a .Refresh there and nothing changed....
any suggestions???