Last post Aug 15, 2007 02:48 PM by TripleThreat
Aug 15, 2007 02:30 PM|TripleThreat|LINK
Just as I was about to ask this question I figured out the answer, so I am just giving the answer because the documentation for EL is horrible. (Well maybe just not exhaustive) Assuming you have your configuration setup correctly for DAAB this is how you
might insert a record into the database and then ask for the new ID of the record:
public static int Insert(string LogIn, string Password, string FirstName, string LastName)
Database db = DatabaseFactory.CreateDatabase();
DbCommand cmd = db.GetStoredProcCommand("AddAgent");
db.AddOutParameter(cmd, "ID", DbType.Int32, 4);
db.AddInParameter(cmd, "LogIn", DbType.String, LogIn);
db.AddInParameter(cmd, "Password", DbType.String, Password);
db.AddInParameter(cmd, "FirstName", DbType.String, FirstName);
db.AddInParameter(cmd, "LastName", DbType.String, LastName);
return Convert.ToInt32(db.GetParameterValue(cmd, "ID"));
Aug 15, 2007 02:40 PM|TATWORTH|LINK
EL as in Enterprise Library?
Anyway congratulations on fixing the problem!
Aug 15, 2007 02:48 PM|TripleThreat|LINK
yeah EL = Enterprise Library.