Database call from 7 using CommerceBuilder.Data?
Posted: Mon Nov 02, 2015 1:05 pm
I had some custom code in version 7.x that was using CommerceBuilder.Data; What is the reference in Gold. I am new to the Gold code but finding my way around for the most part. This has me a little stumped. If someone has a few minutes to help would be appreciated! Thanks in advance!
I had built a table to store customer notes and used "Database database = Token.Instance.Database;":
public string loadusernotes()
{
string Notes = string.Empty;
Database database = Token.Instance.Database;
DbCommand selectcommand = database.GetSqlStringCommand("select Notes from ac_UserNotes where UserId='"+ _UserId +"'");
database.AddInParameter(selectcommand, "@userId", System.Data.DbType.Int32, _UserId);
using (IDataReader reader = database.ExecuteReader(selectcommand))
{
while (reader.Read())
{
Notes = reader[0].ToString();
}
}
return Notes;
}
I had built a table to store customer notes and used "Database database = Token.Instance.Database;":
public string loadusernotes()
{
string Notes = string.Empty;
Database database = Token.Instance.Database;
DbCommand selectcommand = database.GetSqlStringCommand("select Notes from ac_UserNotes where UserId='"+ _UserId +"'");
database.AddInParameter(selectcommand, "@userId", System.Data.DbType.Int32, _UserId);
using (IDataReader reader = database.ExecuteReader(selectcommand))
{
while (reader.Read())
{
Notes = reader[0].ToString();
}
}
return Notes;
}