BoundFields with different DataSources

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Dec 2008
Posts: 19
Reputation: dfs3000my is an unknown quantity at this point 
Solved Threads: 0
dfs3000my dfs3000my is offline Offline
Newbie Poster

BoundFields with different DataSources

 
0
  #1
32 Days Ago
I'm currently populating my GridView using code-behind codes and it looks like this:-

  1. BoundField boundField = new BoundField();
  2. boundField.DataField = "student_name";
  3. boundField.HeaderText = "Name";
  4. GridView1.Columns.Add(boundField);

Is there a possibility where I can have a different DataSource for the different BoundFields that I insert?

Perhaps, Column 1 - 5 uses SQLDataSource1, Column 6 uses SQLDataSource2, and Column 7 uses SQLDataSource3
Last edited by dfs3000my; 32 Days Ago at 2:31 am.
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 435
Reputation: Ramesh S will become famous soon enough Ramesh S will become famous soon enough 
Solved Threads: 82
Ramesh S Ramesh S is offline Offline
Posting Pro in Training
 
0
  #2
31 Days Ago
You cannot assigne multiple data sources such as DataTables, SqlDataSources to the bound columns in a GridView. The data source should come from a single object.

If your want to retrieve records from different database tables which reside in different servers, you need to write some logic to fetach data from different database servers/tables, store it in temprory tables and combine them into single DataTable and assigne them to GridView.
Reply With Quote Quick reply to this message  
Reply

Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC