public void DeleteImgComment(int ImgCommentID) { SQLConnectionClass oConnection = new SQLConnectionClass(); SQLCommandClass oCommand = new SQLCommandClass(); // string sqlIns = "INSERT INTO table (name, information, other) VALUES (@name, @information, @other)"; string queryString = "DELETE FROM ImageComment WHERE ImgCommentID=@ImgCommentID"; oCommand.PrepareDeleteQuery(queryString, oConnection.connection); oCommand.AddDeleteParam("@ImgCommentID", ImgCommentID); oCommand.ExecuteDeleteQuery(); //Command.ExecuteNonQuery(); /* To Future: * Delete smiles, stickers, images */ oConnection.closeConnection(); }
/// <summary> /// Deletes value with ID from table /// </summary> /// <param name="IDColumnName"></param> /// <param name="ID"></param> /// <param name="TableName"></param> public void DeleteValueFromTable(string IDColumnName, int ID, string TableName) { SQLConnectionClass oConnection = new SQLConnectionClass(); SQLCommandClass oCommand = new SQLCommandClass(); // string sqlIns = "INSERT INTO table (name, information, other) VALUES (@name, @information, @other)"; string queryString = "DELETE FROM " + TableName + "WHERE " + IDColumnName + "=@ID"; oCommand.PrepareDeleteQuery(queryString, oConnection.connection); oCommand.AddDeleteParam("@ID", ID); oCommand.ExecuteDeleteQuery(); //Command.ExecuteNonQuery(); /* To Future: * Delete smiles, stickers, images */ oConnection.closeConnection(); }
public void DeleteLike(string GroupName /*Images or other*/, int groupID /*ImageID or other*/, int PeopleID) { SQLConnectionClass oConnection = new SQLConnectionClass(); SQLCommandClass oCommand = new SQLCommandClass(); // string sqlIns = "INSERT INTO table (name, information, other) VALUES (@name, @information, @other)"; string queryString = "DELETE FROM Like WHERE (GroupTableName=@GroupName) and (GroupID=@GroupID) and (PeopleID=@PeopleID)"; oCommand.PrepareDeleteQuery(queryString, oConnection.connection); oCommand.AddDeleteParam("@GroupName", GroupName); oCommand.AddDeleteParam("@GroupID", groupID); oCommand.AddDeleteParam("@PeopleID", PeopleID); oCommand.ExecuteDeleteQuery(); //Command.ExecuteNonQuery(); /* To Future: * Delete smiles, stickers, images */ oConnection.closeConnection(); }