Subscribe to Subscribers
Talk to Webmaster Tony John

Online Members

Phagu Mahato
More...


Forums » .NET » ASP.NET »

How to bind values in gridview


Posted Date: 10 Feb 2012      Posted By:: Kathirvel     Member Level: Silver    Member Rank: 3410     Points: 3   Responses: 1



Hi,
I am using dropdown and listbox controls.
In dropwon one item will be selected, in list box multiple item are selected and stored in databse.
Ex:a 1,2,3,4
a=Referes to dropdown values
1,2,3,4=refers to listbox values.When storing in databese i have stored as a 1,2,3,4 .
When binding in a grid i have bind as follows
a 1
a 2
a 3
a 4
How to perform this.
Thank u in advance




Responses

#657829    Author: KUNDAN KUMAR SRIVASTAVA      Member Level: Gold      Member Rank: 146     Date: 17/Feb/2012   Rating: 2 out of 52 out of 5     Points: 2


Dataset ds = new Dataset();
for (int count = 0;count < arrValues.length;count++)

{
ds.Tables[0].Rows[count][0] = arrValues[count];
}

Gridview1.DataBind()


Thanks,
Kundan



 
Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.



Next : XML file creation using asp.net
Previous : How To Export Excel File to DataBase
Return to Discussion Forum
Post New Message
Category:

Related Messages



Follow us on Twitter: https://twitter.com/dotnetspider

Active Members
TodayLast 7 Daysmore...

Awards & Gifts
Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India
2005 - 2012 All Rights Reserved.
.NET and other trademarks mentioned in this site belong to Microsoft and other respective trademark owners.
Articles, tutorials and all other content offered here is for educational purpose only.
We are not associated with Microsoft or its partners.