Dataset from a Dataset ?

  • Thread starter Thread starter luqman
  • Start date Start date
L

luqman

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
 
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.

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...
 
Thanks very much, Mark, you really solved my problem.

Take care!

Luqman

Mark Rae said:
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.

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...
 
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



luqman said:
Thanks very much, Mark, you really solved my problem.

Take care!

Luqman

Records
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...
 
Back
Top