Click here to Skip to main content
15,892,809 members
Please Sign up or sign in to vote.
3.67/5 (2 votes)
See more:
Hi,
i have gridview and some textboxes i am binding result set to dataset from database here i want to bind some fields to gridview and some field to textboxes. Does it possible to bind dataset values to multiple controls...

Thanks in advance..
Posted
Comments
StianSandberg 26-Mar-13 8:44am    
Yes you can. Have you tried it?
[no name] 26-Mar-13 10:33am    
You should have tried it first, and if you had tried ... you should mention here what have you tried.

1 solution

yes,

GridView
C#
GridView1.DataSource = ds;
GridView1.DataBind();


DropDown
C#
ddp_dataview.DataSource = ds.Tables["test"].DefaultView;
//bind the ddp_dataview to dataview
ddp_dataview.DataTextField = "name";
ddp_dataview.DataValueField = "id";
ddp_dataview.DataBind();
 
Share this answer
 
Comments
[no name] 26-Mar-13 10:32am    
+5

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