public Int64 AddNewEntity(string label, string classuri)
{
SessionManagement sm = new SessionManagement();
string connstr = ConfigurationManager.ConnectionStrings["ProfilesDB"].ConnectionString;
SqlConnection dbconnection = new SqlConnection(connstr);
SqlParameter[] param = new SqlParameter[5];
string error = string.Empty;
dbconnection.Open();
param[0] = new SqlParameter("@label", label);
param[1] = new SqlParameter("@EntityClassURI", classuri);
param[2] = new SqlParameter("@ForceNewEntity", 1);
param[3] = new SqlParameter("@SessionID", sm.Session().SessionID);
param[4] = new SqlParameter("@NodeID", null);
param[4].DbType = DbType.Int64;
param[4].Direction = ParameterDirection.Output;
SqlCommand comm = GetDBCommand(ref dbconnection, "[RDF.].GetStoreNode", 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();
return Convert.ToInt64(param[4].Value.ToString());
}