Hi I have a question regarding the Self-Servicing option in V2.0.
I have generated my code with the following options:
General Settings:
Target Lang: C#
Target Platform: .NET 1.1
Template Group: Self-Servicing
Template Bindings:
SD.TemplateBindings.SharedTemplates.BackwardCompatibility.NET11x
Tasks to Execute:
SD.Presets.SelfServicing.TwoClasses2003
When I generate the code using these options it also generates the HelperClasses file PersistenceInfoProvider.cs (which according to the documentation is an Adapter Specific File). Although the project builds fine with this PersistenceInfoProvider class included, it seems to be using the catalog name in the class's AddElementMapping method instead of picking the catalog name up from the web.config file - therefore when i
change the initial catalog in the Main.ConnectionString within the web.config it ignores this change.
The effect of the problem is this:
My development database is called: dovetail_rrr_tss.
My live database is called: LiveDB
On the live machine I use the following web.config (excerpt):
<appSettings>
<add key="Main.ConnectionString" value="data source=MySqlServer;initial catalog=LiveDB;User ID=MyUser;Password=MyPass;persist security info=False;packet size=4096"/>
And on the live server I get this error: (which mentions the development SQL server catalog):
Server Error in '/' Application.
An exception was caught during the execution of a retrieval query: Invalid object name 'dovetail_rrr_tss.dbo.Staff'.. Check InnerException, QueryExecuted and Parameters of this exception to examine the cause of this exception.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: SD.LLBLGen.Pro.ORMSupportClasses.ORMQueryExecutionException: An exception was caught during the execution of a retrieval query: Invalid object name 'dovetail_rrr_tss.dbo.Staff'.. Check InnerException, QueryExecuted and Parameters of this exception to examine the cause of this exception.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[ORMQueryExecutionException: An exception was caught during the execution of a retrieval query: Invalid object name 'dovetail_rrr_tss.dbo.Staff'.. Check InnerException, QueryExecuted and Parameters of this exception to examine the cause of this exception.]
SD.LLBLGen.Pro.ORMSupportClasses.RetrievalQuery.Execute(CommandBehavior behavior) +232
SD.LLBLGen.Pro.ORMSupportClasses.DaoBase.ExecuteMultiRowRetrievalQuery(IRetrievalQuery queryToExecute, ITransaction containingTransaction, IEntityCollection collectionToFill, Boolean allowDuplicates, IEntityFields fieldsUsedForQuery) +414
SD.LLBLGen.Pro.ORMSupportClasses.DaoBase.PerformGetMultiAction(ITransaction containingTransaction, IEntityCollection collectionToFill, Int64 maxNumberOfItemsToReturn, ISortExpression sortClauses, IPredicate selectFilter, IRelationCollection relations, Int32 pageNumber, Int32 pageSize) +247
SD.LLBLGen.Pro.ORMSupportClasses.DaoBase.GetMulti(ITransaction containingTransaction, IEntityCollection collectionToFill, Int64 maxNumberOfItemsToReturn, ISortExpression sortClauses, IEntityFactory entityFactoryToUse, IPredicate selectFilter, IRelationCollection relations, Int32 pageNumber, Int32 pageSize) +48
SD.LLBLGen.Pro.ORMSupportClasses.EntityCollectionBase.GetMulti(IPredicate selectFilter, Int64 maxNumberOfItemsToReturn, ISortExpression sortClauses, IRelationCollection relations, Int32 pageNumber, Int32 pageSize) +161
SD.LLBLGen.Pro.ORMSupportClasses.EntityCollectionBase.GetMulti(IPredicate selectFilter) +25
TaxSaverTickets.StaffLogin.btnLogin_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\app\StaffLogin.aspx.cs:64
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1292