Click here to Skip to main content
15,911,896 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to fill my pagedatasource with some data i have tried it using creating a new datasource and then assign it to new pagedatasource datasource but i giving me error so then later i have tried using

C#
pagedatasourcename.DataSource = newdatasource.Tables[0].DefaultView;


I got data but i got data on row at 0 index in table but i want full data.
Posted

1 solution

hi,
you can use ObjectDataSource for fill your pagedatasource by this code :
C#
PagedDataSource1.DataSource = ObjectDataSource1.Select();

or use SqlDatatSource with this :
C#
DataSourceSelectArguments arg = new DataSourceSelectArguments();
            DataView dv = (DataView)SqlDataSource1.Select(arg);
            PagedDataSource PagedDataSource1 = new PagedDataSource();
            PagedDataSource1.DataSource = dv;
 
Share this answer
 
v3
Comments
Hitul Mistry 17-Apr-12 6:16am    
Thank you.

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900