Click here to Skip to main content
15,888,454 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Table doubt Pin
Hari-CodeBlogger25-Apr-14 18:37
Hari-CodeBlogger25-Apr-14 18:37 
GeneralRe: Table doubt Pin
Tom Marvolo Riddle27-Apr-14 18:20
professionalTom Marvolo Riddle27-Apr-14 18:20 
GeneralRe: Table doubt Pin
Hari-CodeBlogger6-May-14 23:55
Hari-CodeBlogger6-May-14 23:55 
QuestionChart control X-axis label contains double values with more precision Pin
Kandepu Rajesh24-Apr-14 20:11
Kandepu Rajesh24-Apr-14 20:11 
Questionproject code Pin
varun kumar23-Apr-14 8:19
varun kumar23-Apr-14 8:19 
AnswerRe: project code PinPopular
David Mujica23-Apr-14 8:56
David Mujica23-Apr-14 8:56 
QuestionMessage Removed Pin
23-Apr-14 6:19
miss78623-Apr-14 6:19 
QuestionNeed help updating user information asp.net c# Pin
lala2422-Apr-14 10:52
lala2422-Apr-14 10:52 
this code will tell me that my update was successful but will not update my database. I have stripped the code down to nothing and still cannot find the problem.
C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Configuration;
using System.Data;

namespace GigGuide
{
    public partial class userProfile : System.Web.UI.Page
    {


        protected void Page_Load(object sender, EventArgs e)
        {

            if (!IsPostBack)
            {


                LblUserName.Text = Convert.ToString(Session["New"]);

                string fillTextBoxes = "Select FirstName, Surname,TelephoneNo,PersonalEmail,Password,ContactbyText,ContactByEmail from Personal where UserName ='" + LblUserName.Text + "'";


                SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["ProjectDatabaseConnectionString"].ConnectionString);
                SqlCommand com = new SqlCommand(fillTextBoxes, conn);
                SqlDataReader reader;

                try
                {
                    conn.Open();
                    reader = com.ExecuteReader();
                    reader.Read();

                    TextBoxFirstName.Text = reader["FirstName"].ToString();
                    TextBoxSurName.Text = reader["Surname"].ToString();
                    TextBoxTelNo.Text = reader["TelephoneNo"].ToString();
                    TextBoxOldemail.Text = reader["PersonalEmail"].ToString();
                    TextBoxOldPassword.Text = reader["Password"].ToString();
                    reader.Close();
                    conn.Close();
                }
                catch (Exception ex)
                {
                    Response.Write("ERROR" + ex.ToString());
                }

            }
        }

        protected void ButtonUpdate_Click(object sender, EventArgs e)
        {


            try
            {


                SqlConnection conn1 = new SqlConnection(ConfigurationManager.ConnectionStrings["ProjectDatabaseConnectionString"].ConnectionString);
                conn1.Open();





                // conn1.Open();
                SqlCommand com1;
                string updateQuery = "update Personal set PersonalEmail = @email,FirstName = @fname, Surname = @sname,TelephoneNo = @telno, Password = @password, ContactbyText = @conText, ContactByEmail = @conEmail Where UserName = '" + LblUserName + "'";
                com1 = new SqlCommand(updateQuery, conn1);
                com1.Parameters.AddWithValue("@email", TextBoxNewEmail.Text);
                com1.Parameters.AddWithValue("@password", TextBoxNewPassword.Text);
                com1.Parameters.AddWithValue("@fname", TextBoxFirstName.Text);
                com1.Parameters.AddWithValue("@sname", TextBoxSurName.Text);
                com1.Parameters.AddWithValue("@telno", TextBoxTelNo.Text);
                // com1.Parameters.AddWithValue("@location", locID);
                com1.Parameters.AddWithValue("@conText", RadioButtonListText.SelectedValue);
                com1.Parameters.AddWithValue("@conEmail", RadioButtonListEmail.SelectedValue);


                com1.ExecuteNonQuery();
                conn1.Close();

                Response.Write("Update was successful");
            }






            catch (Exception ex)
            {
                Response.Write("error" + ex.ToString());
            }
        }
    }
}

AnswerRe: Need help updating user information asp.net c# Pin
Wes Aday22-Apr-14 11:11
professionalWes Aday22-Apr-14 11:11 
AnswerRe: Need help updating user information asp.net c# Pin
Praneet Nadkar7-May-14 18:19
Praneet Nadkar7-May-14 18:19 
Questionscrolling jquery popup in Page Pin
Member 947380922-Apr-14 10:38
Member 947380922-Apr-14 10:38 
QuestionMerge 2 cell in Open XML Pin
byka22-Apr-14 2:53
byka22-Apr-14 2:53 
AnswerRe: Merge 2 cell in Open XML Pin
Anurag Gandhi24-Apr-14 5:25
professionalAnurag Gandhi24-Apr-14 5:25 
GeneralTab Control in ASP.NET without using Ajax Pin
Syed Rehman21-Apr-14 20:06
Syed Rehman21-Apr-14 20:06 
GeneralRe: Tab Control in ASP.NET without using Ajax Pin
Blikkies21-Apr-14 21:44
professionalBlikkies21-Apr-14 21:44 
GeneralRe: Tab Control in ASP.NET without using Ajax Pin
Syed Rehman22-Apr-14 3:09
Syed Rehman22-Apr-14 3:09 
GeneralRe: Tab Control in ASP.NET without using Ajax Pin
Blikkies22-Apr-14 3:30
professionalBlikkies22-Apr-14 3:30 
AnswerRe: Tab Control in ASP.NET without using Ajax Pin
R@Vi_Mali24-Apr-14 7:00
professionalR@Vi_Mali24-Apr-14 7:00 
GeneralRe: Tab Control in ASP.NET without using Ajax Pin
Syed Rehman5-May-14 18:54
Syed Rehman5-May-14 18:54 
Questionproblem in ajax reorder list Pin
yogika21-Apr-14 20:05
yogika21-Apr-14 20:05 
Questiondependency between multiple kendo grids Pin
littleGreenDude17-Apr-14 7:44
littleGreenDude17-Apr-14 7:44 
AnswerRe: dependency between multiple kendo grids Pin
littleGreenDude22-Apr-14 8:55
littleGreenDude22-Apr-14 8:55 
QuestionAny idea on Breadcrumbs? Pin
Suraj Sahoo | Coding Passion17-Apr-14 2:20
professionalSuraj Sahoo | Coding Passion17-Apr-14 2:20 
AnswerRe: Any idea on Breadcrumbs? Pin
Wombaticus17-Apr-14 3:07
Wombaticus17-Apr-14 3:07 
GeneralRe: Any idea on Breadcrumbs? Pin
Suraj Sahoo | Coding Passion17-Apr-14 3:12
professionalSuraj Sahoo | Coding Passion17-Apr-14 3:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.