G
Guest
What would be a way to populate DataGrid with data from SQL table using DAAB
Thanks
Thanks
William Ryan eMVP said:You can bind a DataGrid to Any datatable, it doesn't care how you fill it.
You can do it manually or from a web service or through dataadapter.fill
etc. So if you had DataSet ds = SqlHelper.ExecuteDataset(Params)
Then the next line (or any thereafter that can see ds [so you may want to
declare it at the module level) could be
dataGrid.datasource = ds
That's all there is to it.
HTH,
Bill
MArk said:What would be a way to populate DataGrid with data from SQL table using DAAB?
Thanks
Mark Goldin said:And that what I tried too.
When form runs the datagrid comes up in somehow strange way.
It does not show data, instead it has a plus sigh only. When I expand it
then I see a child node named table. That child node is actually a
hyperlink.
When I click on that link then I see my data.
Can you explain that?
Thanks
William Ryan eMVP said:You can bind a DataGrid to Any datatable, it doesn't care how you fill it.
You can do it manually or from a web service or through dataadapter.fill
etc. So if you had DataSet ds = SqlHelper.ExecuteDataset(Params)
Then the next line (or any thereafter that can see ds [so you may want to
declare it at the module level) could be
dataGrid.datasource = ds
That's all there is to it.
HTH,
Bill
usingMArk said:What would be a way to populate DataGrid with data from SQL table
DAAB?Thanks
William Ryan eMVP said:Have you set the DataMember property too? It sounds like that's the likely
culprit.
Mark Goldin said:And that what I tried too.
When form runs the datagrid comes up in somehow strange way.
It does not show data, instead it has a plus sigh only. When I expand it
then I see a child node named table. That child node is actually a
hyperlink.
When I click on that link then I see my data.
Can you explain that?
Thanks
William Ryan eMVP said:You can bind a DataGrid to Any datatable, it doesn't care how you fill it.
You can do it manually or from a web service or through dataadapter.fill
etc. So if you had DataSet ds = SqlHelper.ExecuteDataset(Params)
Then the next line (or any thereafter that can see ds [so you may want to
declare it at the module level) could be
dataGrid.datasource = ds
That's all there is to it.
HTH,
Bill
What would be a way to populate DataGrid with data from SQL table using
DAAB?
Thanks