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
SIVA
NA
742
707.4k
Not retrieving the values from GridView
Dec 28 2011 7:04 AM
Hi All,
I have GridView with Edit & Delete command
when i am trying to update the data in gridview its taking previous data only.
my code is as follows
RowUpdating :
oProp.DNo =
int
.Parse(gvDept.Rows[e.RowIndex].Cells[0].Text);
oProp.DName = ((
TextBox
)(gvDept.Rows[e.RowIndex].Cells[1].Controls[0])).Text;
oProp.Location = ((
DropDownList
)(gvDept.Rows[e.RowIndex].FindControl(
"DDList"
))).Text;
oData.UpdateDetails(oProp);
gvDept.EditIndex = -1;
gvDept.DataSource = oData.ShowDetails();
gvDept.DataBind();
UpdateDetails:
oCmd.Parameters.Clear();
oCmd.CommandText =
"tbl_Department_InsertOrUpdate"
;
oCmd.Parameters.AddWithValue(
"DNo"
,oProp.DNo);
oCmd.Parameters.AddWithValue(
"DName"
,oProp.DName);
oCmd.Parameters.AddWithValue(
"Location"
,oProp.Location);
oCon.Open();
oCmd.ExecuteNonQuery();
oCon.Close();
I have traced this its not retrieving values from Gridview its taking the previous values and its performing the update operation
Reply
Answers (
2
)
How to create popup window with DataList using jquery in asp.net
Generate DLL files from PHP scripts like i can in Perl