Wrox Programmer Forums
|
VS.NET 2002/2003 Discussions about the Visual Studio.NET programming environment, the 2002 (1.0) and 2003 (1.1). ** Please don't post code questions here ** For issues specific to a particular language in .NET, please see the other forum categories.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VS.NET 2002/2003 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 12th, 2003, 11:00 PM
kaz kaz is offline
Authorized User
 
Join Date: Dec 2003
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to update data?

This is a part of code to modify data from the existing data from database to new data that typed in the web page. Once it reads the data from database, the ModifyCustomer method takes the parameters as the old data from the database. Could you tell me how to update the data?

Thanks,

private void Page_Load(object sender, System.EventArgs e)
        {
            if (Tools.IsLoggedIn())
            {
                Process = "MODIFY";

                MyProject.UserDetails myUserDetails = new MyProject.UserDetails();
                MyProject.User obj = new MyProject.User();

                myUserDetails = obj.GetUserDetails(Request.Cookies["email"].Value);
                txtLastName.Text = myUserDetails.LastName;
                txtFirstName.Text = myUserDetails.FirstName;
                txtEmail.Text = Request.Cookies["email"].Value;
                txtUserPwd.Text = myUserDetails.UserPwd;
                txtAdd1.Text = myUserDetails.Address;
                txtPrefix.Text = myUserDetails.Prefix;
                txtPhoneNumber.Text = myUserDetails.PhoneNumber;
                txtEmail.Enabled = false;
                obj = null;

                GuestMenu.Visible = false;
                RegisteredMenu.Visible = true;
}
}

private void btnSubmit_Click(object sender, System.EventArgs e)
        {
            if (Page.IsValid)
            {
                MyProject.User obj = new MyProject.User();
                string strStatus;

// Code for Update goes here


                    strStatus = obj.ModifyCustomer(txtLastName.Text,
                        txtFirstName.Text,
                        txtEmail.Text,
                        txtUserPwd.Text,
                        txtAdd1.Text,
                        txtPrefix.Text,
                        txtPhoneNumber.Text);
.........






Similar Threads
Thread Thread Starter Forum Replies Last Post
how to update data to DB from data set umank.88 ADO.NET 1 May 7th, 2008 10:07 PM
Can we update data through dataReader vedprakash4 ADO.NET 1 December 30th, 2007 12:27 PM
Update Data in Datagridview munmin2000 Visual Basic 2005 Basics 1 November 5th, 2007 03:27 AM
How do i Update data through a datagridview jazzydonald VB How-To 0 October 26th, 2007 02:52 AM
Update data from another table Sheikha SQL Language 1 July 11th, 2005 05:32 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.