DAAB and datagrid

W

William Ryan eMVP

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
 
M

Mark Goldin

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
MArk said:
What would be a way to populate DataGrid with data from SQL table using DAAB?

Thanks
 
W

William Ryan eMVP

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
MArk said:
What would be a way to populate DataGrid with data from SQL table
using
DAAB?
 
M

Mark Goldin

What do I set to?
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top