예제 #1
0
        public string deleteAllString(string creator, string childId)
        {
            string             response = "";
            parameterDeleteAll para     = new parameterDeleteAll();

            try
            {
                para.creator = new Guid(creator);
                para.childId = new Guid(childId);
                response     = deleteAll(para);
            }
            catch (Exception ex)
            {
                response = ex.ToString();
            }

            return(response);
        }
예제 #2
0
        public string deleteAll(parameterDeleteAll use)
        {
            string response = "Success";

            try
            {
                SqlConnection con = new SqlConnection(data);
                SqlCommand    cmd = new SqlCommand("DELETE FROM courseParameter WHERE childId = @childId", con);
                cmd.Parameters.AddWithValue("@childId", use.childId);
                con.Open();
                cmd.ExecuteNonQuery();
                con.Close();
            }
            catch (SqlException ex)
            {
                response = ex.ToString();
            }
            catch (Exception ex)
            {
                response = ex.ToString();
            }
            return(response);
        }