Click here to Skip to main content
11,719,480 members (89,430 online)
Rate this: bad
Please Sign up or sign in to vote.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
namespace WebProjectOISD.ITuser
    public partial class WebEditProfile1 : System.Web.UI.Page
        SqlConnection con = new SqlConnection("data source=MANAS-PC\\SQLEXPRESS; initial catalog=Project ;integrated security=true;");
        protected void Page_Load(object sender, EventArgs e)
        protected void submit_Click(object sender, EventArgs e)
            int id = Convert.ToInt32(Session["id"].ToString());
            string query = "update ITTEAM set Name='" +TextBox1.Text+"',Username='" + TextBox2.Text+"',Mobile='" + TextBox3.Text+"',Email_Id='"+TextBox4.Text+"' where IT_Team_Id='" + id+ "'";
            SqlCommand cmd = new SqlCommand(query, con);
Posted 27-Feb-13 3:21am
Edited 27-Feb-13 3:27am
(no name)2.6K
Asim Mahmood at 27-Feb-13 9:29am
what is error and at which line error is?
BC @ CV at 27-Feb-13 9:29am
If you want an answer your going to need to supply more perhaps what exactly the error message is.
ThePhantomUpvoter at 27-Feb-13 9:29am
It would really help to know what "the error" is. And you really should look into parameterized queries instead of the SQL injection attack mess you have going on.
joshrduncan2012 at 27-Feb-13 11:34am
I second the SQL injection prevention measures.
ThePhantomUpvoter at 27-Feb-13 9:32am
And id is an integer and you are treating as if is were a string in your query. Which a parameterized query would help with.
Hrushikesh_phapale at 27-Feb-13 10:34am
In which line you getting the error????

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 1,734
1 OriginalGriff 690
2 Maciej Los 569
3 Richard MacCutchan 540
4 F-ES Sitecore 510

Advertise | Privacy | Mobile
Web03 | 2.8.150901.1 | Last Updated 27 Feb 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100