471,327 Members | 2,727 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,327 software developers and data experts.

How to put a collection into dataset?

I use a method that returns either a dataset or a collection depending
on the method called. Since no database is involved at the layer I'm
working, I can't use a data adapter's fill method to fill these results
into my local dataset. How can I get these results into the local
dataset?

I need the results place into a dataset to allow working with
DataGridTableStyle for grid formatting.

Thanks,
Brett

Dec 12 '05 #1
2 1076
Loop through the collection and dynamically create a DataTable in
memory, then you can stick that DataTable in you dataset if you need it
in there.

Dec 12 '05 #2
Brett,

You shouldn't have to get the results into a dataset to allow wirking
with the DataGridTableStyle... It should be able to work with whatever
BindingManager is being used to get the data from.

If you want to populate a data set, then it is easy, all you have to do
is get the appropriate table, and call the Add method on the
DataRowCollection returned to you from the Rows property.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Brett Romero" <ac*****@cygen.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
I use a method that returns either a dataset or a collection depending
on the method called. Since no database is involved at the layer I'm
working, I can't use a data adapter's fill method to fill these results
into my local dataset. How can I get these results into the local
dataset?

I need the results place into a dataset to allow working with
DataGridTableStyle for grid formatting.

Thanks,
Brett

Dec 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by NuB | last post: by
34 posts views Thread by Craig Buchanan | last post: by
5 posts views Thread by Brad | last post: by
4 posts views Thread by =?Utf-8?B?UmljaA==?= | last post: by
5 posts views Thread by Simon Woods | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.