Exemplo n.º 1
0
        public void Update()
        {
            string        strsql        = "update State set " + "StateName= '" + StateName.Replace("'", "''") + "', " + "CountryId= " + CountryId + ", " + "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();
        }