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# / June 2007

Tip: Looking for answers? Try searching our database.

Code to parse a SQL Result into list of datatables

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sam Shrefler - 14 Jun 2007 15:31 GMT
Is there any code part of the .NET Framework or any suggestions at the
best way to handle the following situation?

Results from SQL Select statement:

MeasureDate | Name | Width | Height
01/01/07 | Flower | 10 | 10
01/01/07 | Tree | 11 | 11
01/01/07 | Bush | 12 | 12
02/01/07 | Flower | 11 | 10
02/01/07 | Tree | 12 | 11
02/01/07 | Bush | 13 | 12

I'd like a way to create the following structure:

A List (myList) that holds dataTables based on MeasureDate:

myList['01/01/07'] would hold a datatable

Flower | 10 | 10
Tree | 11 | 11
Bush | 12 | 12

Does that make sense?

Thanks

Sam
Nicholas Paldino [.NET/C# MVP] - 14 Jun 2007 16:12 GMT
Sam,

   All you really need is a DataView for this.  You can create two separate
DataViews on the same table, and set the filter on one to have a MeasureDate
of 1/1/07, and the filter on the other DataView to be a MeasureDate of
2/1/07.  Then, you can use the DataView instances like you would DataTables.

   Hope this helps.

Signature

         - Nicholas Paldino [.NET/C# MVP]
         - mvp@spam.guard.caspershouse.com

> Is there any code part of the .NET Framework or any suggestions at the
> best way to handle the following situation?
[quoted text clipped - 24 lines]
>
> Sam

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.