Try this:
VB Code:
Try Dim ds As New Data.DataSet Dim da As New OleDb.OleDbDataAdapter("select * from library_tbl", cn) da.Fill(ds) Me.DataGrid1.DataSource = ds With Me.DataGrid1.TableStyles [B]Dim tableStyle1 As New DataGridTableStyle[/B] With .Item("dgtsLibId") [B]tableStyle1[/b].MappingName = "library_tbl" End With End With Catch ex As Exception MessageBox.Show(ex.ToString) End Try
My changes are in bold. It worked on my machine.
One other thing to note: I believe MappingName is case sensitive.
Good luck!




Reply With Quote