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); }
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); }