public bool DeleteTriple(Int64 subjectid, Int64 predicateid, Int64 objectid)
{
SessionManagement sm = new SessionManagement();
string connstr = ConfigurationManager.ConnectionStrings["ProfilesDB"].ConnectionString;
SqlConnection dbconnection = new SqlConnection(connstr);
SqlCommand dbcommand = new SqlCommand();
SqlParameter[] param = new SqlParameter[6];
bool error = false;
try
{
param[0] = new SqlParameter("@SubjectID", subjectid);
param[1] = new SqlParameter("@PredicateID", predicateid);
param[2] = new SqlParameter("@ObjectID", objectid);
param[3] = new SqlParameter("@SessionID", sm.Session().SessionID);
param[4] = new SqlParameter("@DeleteInverse", 1);
param[5] = new SqlParameter("@Error", "");
param[5].DbType = DbType.Boolean;
param[5].Direction = ParameterDirection.Output;
SqlCommand comm = GetDBCommand(ref dbconnection, "[RDF.].DeleteTriple", CommandType.StoredProcedure, CommandBehavior.CloseConnection, param);
//For Output Parameters you need to pass a connection object to the framework so you can close it before reading the output params value.
ExecuteSQLDataCommand(comm);
comm.Connection.Close();
if (dbconnection.State == ConnectionState.Open)
dbconnection.Close();
error = Convert.ToBoolean(param[5].Value);
Framework.Utilities.Cache.AlterDependency(subjectid.ToString());
if (error)
Framework.Utilities.DebugLogging.Log("Delete Triple blew up with the following values -- {[RDF.].DeleteTriple} DeleteInverse: 1 SubjectID:" + subjectid.ToString() + " PredicateID:" + predicateid.ToString() + " ObjectID:" + objectid.ToString() + " SessionID:" + sm.Session().SessionID);
}
catch (Exception e)
{
Framework.Utilities.DebugLogging.Log(e.Message + e.StackTrace);
throw new Exception(e.Message);
}
return error;
}