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 / ASP.NET / General / December 2007

Tip: Looking for answers? Try searching our database.

Dataset from a Dataset ?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
luqman - 05 Dec 2007 10:47 GMT
I have One Dataset with Invoice Data for 5 Customers.

I have 5 GridView Controls, and I want to display each Customer Records in
each GridView, how can I ?

Can I create a dataset from existing Dataset for each customer, so that I
can set the datasouce of gridview controls or anything similar.

Any idea please ?

Best Regards,

Luqman
Mark Rae [MVP] - 05 Dec 2007 11:03 GMT
>I have One Dataset with Invoice Data for 5 Customers.
>
[quoted text clipped - 3 lines]
> Can I create a dataset from existing Dataset for each customer, so that I
> can set the datasouce of gridview controls or anything similar.

DataSet MyDS = <however you create your DataSet>;

MyDS.Tables[0].DefaultView.RowFilter = "CustomerID = 1";
MyGridView1.DataSource = MyDS.Tables[0].DefaultView;
MyGridView1.DataBind();

MyDS.Tables[0].DefaultView.RowFilter = "CustomerID = 2";
MyGridView2.DataSource = MyDS.Tables[0].DefaultView;
MyGridView2.DataBind();

Etc...

Signature

Mark Rae
ASP.NET MVP
http://www.markrae.net

luqman - 05 Dec 2007 11:30 GMT
Thanks very much, Mark, you really solved my problem.

Take care!

Luqman

> >I have One Dataset with Invoice Data for 5 Customers.
> >
[quoted text clipped - 20 lines]
> ASP.NET MVP
> http://www.markrae.net
luqman - 05 Dec 2007 12:51 GMT
Hi,

Just one question left, can I distinctly get the CustomerID from Dataset for
5 Customers, to fill in a Combo List, just 5 CustomerIDs from Invoice
Dataset ?

Just like this query : Select distinct CustomerID from InvoiceTable

Any idea please ?

Best Regards,

Luqman

> Thanks very much, Mark, you really solved my problem.
>
[quoted text clipped - 28 lines]
> > ASP.NET MVP
> > http://www.markrae.net
Mark Rae [MVP] - 05 Dec 2007 13:21 GMT
> Just one question left, can I distinctly get the CustomerID from Dataset
> for
> 5 Customers, to fill in a Combo List, just 5 CustomerIDs from Invoice
> Dataset ?
>
> Just like this query : Select distinct CustomerID from InvoiceTable

In 3.5 you can do this very easily with LINQ...

Otherwise: http://www.codeproject.com/KB/grid/DistinctIDsDataSet.aspx

Signature

Mark Rae
ASP.NET MVP
http://www.markrae.net


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.