Hi Guys,
I am working on a windows application. I just wanted to generalize the code for all the master forms. So I decided to create a user control with specific containers. We are using LINQ to SQL and I wanted to pass on a table name and get the corresponding data. I have a BindingSource and a BindingNavigator along with a DataGridView. I use the following code:
Dim t As Type = objDB.GetType()
Dim p As PropertyInfo = t.GetProperty(value)
Dim table = CType(p.GetValue(objDB, Nothing), ITable)
dgvMaster.DataSource = table 'attaching the table as datasource to datagrid works
BSMaster.DataSource = table 'trying to attach the datasource to binding source fails
All it takes is to figure out how to bind it to binding source and I am done. Any ideas or help in this regard is much appreciated.
Thanks,
Raja