Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / December 2005

Tip: Looking for answers? Try searching our database.

How to put a collection into dataset?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Brett Romero - 12 Dec 2005 21:43 GMT
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
tdavisjr - 12 Dec 2005 21:47 GMT
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.
Nicholas Paldino [.NET/C# MVP] - 12 Dec 2005 21:50 GMT
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.

Signature

         - Nicholas Paldino [.NET/C# MVP]
         - mvp@spam.guard.caspershouse.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
[quoted text clipped - 7 lines]
> Thanks,
> Brett

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.