My LLBL info
LLBLGen Pro 2.5 Final
SD.LLBLGen.Pro.ORMSupportClasses.NET20.dll runtime version 2.5.07.1019
Adapter + .NET 2.0
MSSQL 2000/2005
I have created 2 databases on the same MSSQL server.
One is called 'Dev' and the other is called 'Current'
Here's the code:
[TestMethod]
public void TestMethod1()
{
string connstr;
// DevDB
connstr = ConfigurationManager.ConnectionStrings["DevDB.ConnectionString"].ConnectionString;
RunTests(connstr);
// CurrentDB
connstr = ConfigurationManager.ConnectionStrings["CurrentDB.ConnectionString"].ConnectionString;
RunTests(connstr);
}
private void RunTests(string connstr)
{
try
{
TrxEntity objTrxEntity = new TrxEntity();
objTrxEntity.TransactionID = "TEST00";
objTrxEntity.TxnDateTime = DateTime.Now;
objTrxEntity.TxnSentBy = "USER01";
objTrxEntity.TxnSentTo = "USER02";
objTrxEntity.TxnTypeCode = "NR";
objTrxEntity.TNResNo = 1001;
objTrxEntity.BookerMemberCode = "Booker One";
objTrxEntity.BookerResNo = "BOOKER01";
objTrxEntity.ProviderMemberCode = "Provider One";
objTrxEntity.ProviderResNo = "PROVIDER01";
DataAccessAdapter d = new DataAccessAdapter(connstr);
d.SaveEntity(objTrxEntity);
}
catch (Exception ex)
{
throw ex;
}
}
When this runs, the test passes, but it writes 2 entries to the Dev.dbo.Tb_Trx table instead of one entry to each table in the different databases.
If I remove the test for the Dev db and take the Dev db offline, the code fails even though the Current db is online.
Here's the stack trace for that exception
at SD.LLBLGen.Pro.ORMSupportClasses.ActionQuery.Execute()
at SD.LLBLGen.Pro.ORMSupportClasses.BatchActionQuery.Execute()
at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.ExecuteActionQuery(IActionQuery queryToExecute)
at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.PersistQueue(List`1 queueToPersist, Boolean insertActions, Int32& totalAmountSaved)
at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.SaveEntity(IEntity2 entityToSave, Boolean refetchAfterSave, IPredicateExpression updateRestriction, Boolean recurse)
at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.SaveEntity(IEntity2 entityToSave)
at ULS.Test.LLBLTester.RunTests(String connstr) in D:\Projects\ULS\Current\ULS.Test\LLBLTester.cs:line 96
When I look at the entitly list in the code generator it shows that the table mapped on Dev.dbo.Tb_Trx, instead of just dbo.Tb_Trx
How do I make LLBL get this information from the connection string?
Thanks,
Rob Hill
thisbox71 AT gmail.com