Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET
Hi Friends I need an help
 
How to use multiple dataset in a single grid view using asp.net
For egs: the first 3 three cells is filled wid one dataset and the rest with other dataset..
If so den how...
is there any other solution either than this...
 
Regards
Sushil Dharmar
Posted 19-Apr-12 5:41am
Edited 19-Apr-12 6:04am
v3
Comments
RDBurmon at 19-Apr-12 10:43am
   
Can you share structure of your datasets ?
Mark Nischalke at 19-Apr-12 10:54am
   
The data structure is irrelevant
Mark Nischalke at 19-Apr-12 10:55am
   
Don't ask for urgent help, it is very rude. This is a volunteer site and people will answer on their time, not yours. Bluntly, it may be urgent to you, but not to anyone here.
Sushil_Sri at 19-Apr-12 11:03am
   
ok Mark..
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

The grid can only be bound to one DataSource so you would need to either merge them or construct one with the elements necessary.
  Permalink  
Comments
Sushil_Sri at 19-Apr-12 11:06am
   
can we use any other data controls either than gridview..?
Mark Nischalke at 19-Apr-12 13:46pm
   
You can use any control you'd like, but they all only accept a single DataSource.
If you want more then you'll need to write it yourself
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Hi,
You need to merge those datasets and bind the resulting dataset to your control, take a look at this post:
how to merge two data set[^]
 
I hope it helps,
Cheers
  Permalink  
Comments
Sushil_Sri at 21-Apr-12 22:51pm
   
ok.....
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

Hi Friends....
Code for Binding Dataset to Grid View
---------------------------------------------------
SqlConnection con = new SqlConnection(" xyz");
string str = "select colmn1,colmn2 from tablename";
SqlDataAdapter da = new SqlDataAdapter(str,con);
DataSet ds = new DataSet();
da.Fill(ds);
GridView1.DataSource = ds;
GridView1.DataBind();
---------------------------------------------------
Enjoy......
  Permalink  
Comments
CHill60 at 29-Apr-14 12:40pm
   
OP wanted to use multiple datasets. This only covers a single dataset. And it's a year too late on an already answered post

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 304
1 Sergey Alexandrovich Kryukov 255
2 Maciej Los 250
3 Shweta N Mishra 216
4 PIEBALDconsult 174
0 OriginalGriff 7,660
1 Sergey Alexandrovich Kryukov 7,072
2 DamithSL 5,586
3 Manas Bhardwaj 4,946
4 Maciej Los 4,665


Advertise | Privacy | Mobile
Web04 | 2.8.1411023.1 | Last Updated 29 Apr 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100