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
keerthi
NA
3
1.5k
Query regarding Updating record
Oct 13 2011 5:35 AM
I have written procedure for updating country including already exist.
While running the code, if a record is updated it is "showing record updated successfuly" and when another record is updated with the same name in the list record is not updated but the message is showing "record updated successfully". Find the below c# code which I have written
protected void btnSave_Click(object sender, EventArgs e)
{
Country objCountry = new Country();
CountryBAL objCountryBal = new CountryBAL();
objCountry.CountryName = txtCountryName.Text;
objCountry.Status = Convert.ToInt16(ddlStatus.SelectedValue);
if (ViewState["Id"] != null)
{
if (!string.IsNullOrEmpty(ViewState["Id"].ToString()))
{
objCountry.CountryId = Convert.ToInt32(ViewState["Id"]);
bool status = (new CountryBAL().UpdateCountry(objCountry));
if (status == true)
{
BindCountry();
tabErrMess.Visible = true;
lblMessage.Text = "Record Updated Successfully";
txtCountryName.Text = "";
ViewState["Id"] = null;
}
else
{
tabErrMess.Visible = true;
lblMessage.Text = "Updatation Failed";
ImgMsg.Visible = false;
}
}
}
Reply
Answers (
5
)
MicroSoft Jscript runtime error:Sys.webforms.pagerequestmanager server error exception:
Microsoft jscript runtime error: