Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi, I am trying to execute the following part of code in production environment
using (var db = ApplicationContext.Current.DatabaseContext.Database) { db.CommandTimeout = 200; var hotelGenDataResults = db.Fetch<Hotel_GeneralData>(";EXEC [dbo].[GetBookingHotelGeneralData] @hotelId, @languageCode", new { hotelId = providerHotel.hotel_id, languageCode = locale.ToLower() }); if (hotelGenDataResults != null && hotelGenDataResults.Any()) { providerHotel.Hotel_GeneralData = hotelGenDataResults.ToList().FirstOrDefault(); } var hotelPhotosResult = db.Fetch<Hotel_Photos>(";EXEC [dbo].[GetBookingHotelAndRoomsPhotos] @hotelId", new { hotelId = providerHotel.hotel_id }); if (hotelPhotosResult != null && hotelPhotosResult.Any()) { providerHotel.Hotel_Photos = hotelPhotosResult.ToList(); } var hotelFacilitiesResult = db.Fetch<Hotel_Facilities>(";EXEC [dbo].[GetBookingHotelFacilities] @hotelId, @languageCode", new { hotelId = providerHotel.hotel_id, languageCode = locale.ToLower() }); if (hotelFacilitiesResult != null && hotelFacilitiesResult.Any()) { providerHotel.Hotel_Facilities = hotelFacilitiesResult.ToList(); } }
and i am getting the following error
2015-06-02 10:38:18,142 [57] INFO Umbraco.Core.Persistence.UmbracoDatabase - [Thread 32] at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData() at System.Data.SqlClient.SqlDataReader.get_MetaData() at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource1 completion, Int32 timeout, Task& task, Boolean asyncWrite) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) at System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior) at StackExchange.Profiling.Data.ProfiledDbCommand.ExecuteDbDataReader(CommandBehavior behavior) in c:\Code\github\SamSaffron\MiniProfiler\StackExchange.Profiling\Data\ProfiledDbCommand.cs:line 248 at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader() at Umbraco.Core.Persistence.Database.<Query>d__71.MoveNext()
1 wrapCloseInAction) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action
1 completion, Int32 timeout, Task& task, Boolean asyncWrite) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) at System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior) at StackExchange.Profiling.Data.ProfiledDbCommand.ExecuteDbDataReader(CommandBehavior behavior) in c:\Code\github\SamSaffron\MiniProfiler\StackExchange.Profiling\Data\ProfiledDbCommand.cs:line 248 at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader() at Umbraco.Core.Persistence.Database.<Query>d__7
On development environment it works perfect. Any suggestions please?
Thomas
Fixed, the problem was with a DateTime conversion and not with the SP execution.
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Error on executing SP in Production Environment
Hi, I am trying to execute the following part of code in production environment
and i am getting the following error
On development environment it works perfect. Any suggestions please?
Thomas
Fixed, the problem was with a DateTime conversion and not with the SP execution.
is working on a reply...