Hello,
We have a stored procedure called FriendSuggestion which we've mapped using LLBLGen Designer.
This is the generated code in the RetrivalProcedures.cs file:
private static StoredProcedureCall CreateFriendSuggestionCall(IDataAccessCore dataAccessProvider, System.Guid userId, System.Int32 numberOfLevels, System.Int32 pageNumber, System.Int32 pageSize, System.Boolean isRandom, System.String userName)
{
return new StoredProcedureCall(dataAccessProvider, @"[MonoX2].[dbo].[FriendSuggestion]", "FriendSuggestion")
.AddParameter("@UserId", "UniqueIdentifier", 0, ParameterDirection.Input, true, 0, 0, userId)
.AddParameter("@NumberOfLevels", "Int", 0, ParameterDirection.Input, true, 10, 0, numberOfLevels)
.AddParameter("@PageNumber", "Int", 0, ParameterDirection.Input, true, 10, 0, pageNumber)
.AddParameter("@PageSize", "Int", 0, ParameterDirection.Input, true, 10, 0, pageSize)
.AddParameter("@IsRandom", "Bit", 0, ParameterDirection.Input, true, 0, 0, isRandom)
.AddParameter("@UserName", "NVarChar", 200, ParameterDirection.Input, true, 0, 0, userName);
}
In LLBLGen 3.1 we used the same setup and called the stored procedure using the following approach:
EntityCollection<FriendSuggestionTypedViewEntryEntity> userEntities = new EntityCollection<FriendSuggestionTypedViewEntryEntity>();
using (IRetrievalQuery query = RetrievalProcedures.GetFriendSuggestionCallAsQuery(userId, numberOfLevels, pageNumber, pageSize, isRandom, searchTerm))
{
using (IDataAccessAdapter adapter = DependencyInjectionFactory.Resolve<IGenericRepository>().GetAdapter())
{
using (IDataReader reader = adapter.FetchDataReader(query, CommandBehavior.CloseConnection))
In our scenario the development database name is usually different than the version of the live system for example. With LLBLGen 3.1 this worked without any problems.
However recently after upgrading to LLBLGen 4.1 this no longer appears to be the case as we're experiencing the following errors:
SD.LLBLGen.Pro.ORMSupportClasses.ORMQueryExecutionException: An exception was caught during the execution of a retrieval query: Reference to database and/or server name in 'MonoX2.dbo.FriendSuggestion' is not supported in this version of SQL Server.. Check InnerException, QueryExecuted and Parameters of this exception to examine the cause of this exception. ---> System.Data.SqlClient.SqlException: Reference to database and/or server name in 'MonoX2.dbo.FriendSuggestion' is not supported in this version of SQL Server.
The exception is thrown when the FetchDataReader is called. This occurs when we use a different database name. Can you help me track down the issue and fix it?
Regards,
Mario