protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["UserType"] == null || Convert.ToInt32(Session["UserType"]) != Global.AdminUserType) //admin
     {
         Global.Application_AccessDenied(sender, e);
     }
     else
     {
         SqlDataSource1.ConnectionString = Global.getConnectionString();
     }
     IndustryName.Focus();
 }
Exemple #2
0
        public void Update()
        {
            string        strsql        = "update Industry set " + "IndustryName= '" + IndustryName.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();
        }