public void Update() { string strsql = "update JobSeeker set " + "TitleId= " + TitleId + ", " + "FirstName= '" + FirstName.Replace("'", "''") + "', " + "LastName= '" + LastName.Replace("'", "''") + "', " + "EmailId= '" + EmailId.Replace("'", "''") + "', " + "Status= '" + Status.Replace("'", "''") + "' " + " where ID =" + Id; SqlConnection ObjConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["MyJobPortal"].ConnectionString); ObjConnection.Open(); SqlCommand ObjCommand = new SqlCommand(strsql, ObjConnection); ObjCommand.ExecuteNonQuery(); ObjConnection.Dispose(); ObjCommand.Dispose(); }
public void Update() { string strsql = "update Person set " + "TitleId= " + TitleId + ", " + "FirstName= '" + FirstName.Replace("'", "''") + "', " + "LastName= '" + LastName.Replace("'", "''") + "', " + "EmailId= '" + EmailId.Replace("'", "''") + "', " + "Password= '******'", "''") + "', " + "Role= '" + Role.Replace("'", "''") + "', " + "Status= '" + Status.Replace("'", "''") + "', " + "EnableEmail= " + Convert.ToInt32(EnableEmail) + " " + " where ID =" + Id; SqlConnection ObjConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["MyJobPortal"].ConnectionString); ObjConnection.Open(); SqlCommand ObjCommand = new SqlCommand(strsql, ObjConnection); ObjCommand.ExecuteNonQuery(); ObjConnection.Dispose(); ObjCommand.Dispose(); }