TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
B M Suchitra
NA
507
418.7k
Load All gridview rows with data from dataset
Nov 30 2011 10:41 PM
Hi,
I have a gridview to which i am adding rows dynamically at the click event of a button placed in gridview footer template. When i want to update data. I have to load the gridview with all the rows required. I get the sql table data in the dataset object and then i have to load this in the gridview. How can i do this?
Only one row gets loaded when i use this code:
DataSet DSContact = DMLObj.Load_DataSet("Usp_LoadData", "ContactPerson", idf);
foreach (GridViewRow row in GVContactPerson.Rows)
{
((TextBox)row.FindControl("txtContactName")).Text=DSContact.Tables[0].Rows[0]["ContactName"].ToString();
((TextBox)row.FindControl("txtemail")).Text = DSContact.Tables[0].Rows[0]["ContactEmailID"].ToString();
((TextBox)row.FindControl("txtmob1")).Text = DSContact.Tables[0].Rows[0]["ContactMobile"].ToString();
Session["contact"] = ((TextBox)row.FindControl("txtContactName")).Text;
string pid = Convert.ToString(DMLObj.getid("Select ContactPersonID from tbl_ContactPersonDetails where ContactName='" + Session["contact"].ToString() + "'"));
Session["contactID"] = pid;
}
Reply
Answers (
5
)
PHP login form
How to deploy asp.net 2.0 web application in local system?