Try our conversational search powered by Generative AI!

I am getting below error while creating start page through VisualStudio.

Vote:
 

Hi,

I am following steps mentioned in http://world.episerver.com/Documentation/CMS/Get-started-with-CMS/5-Creating-a-start-page/.

Server Error in '/' Application.Could not find stored procedure 'sp_DatabaseVersion'.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: System.Data.SqlClient.SqlException: Could not find stored procedure 'sp_DatabaseVersion'.

Source Error: 

[No relevant source lines]


Source File: c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\91c4c8eb\97de0eb3\App_global.asax.0.cs    Line: 0 

Stack Trace: 

[SqlException (0x80131904): Could not find stored procedure 'sp_DatabaseVersion'.]
   System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +1753346
   System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +5295154
   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +242
   System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) +1682
   System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +269
   System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite) +1325
   System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite) +175
   System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite) +205
   System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +160
   EPiServer.DataAccess.<>c__DisplayClass1.b__0() +163
   EPiServer.Data.Providers.<>c__DisplayClassa.b__9() +34
   EPiServer.Data.Providers.<>c__DisplayClass1`1.b__0() +89
   EPiServer.Data.Providers.SqlTransientErrorsRetryPolicy.Execute(Func`1 method) +1333
   EPiServer.Data.Providers.SqlDatabaseHandler.Execute(Func`1 action) +214
   EPiServer.Data.Providers.SqlDatabaseHandler.Execute(Action action) +157
   EPiServer.DataAccess.DataAccessBase.ValidateVersion(IDatabaseHandler handler) +131
   EPiServer.Initialization.<>c__DisplayClass1.b__0() +32
   EPiServer.Data.Providers.<>c__DisplayClassa.b__9() +34
   EPiServer.Data.Providers.<>c__DisplayClass1`1.b__0() +89
   EPiServer.Data.Providers.SqlTransientErrorsRetryPolicy.Execute(Func`1 method) +1333
   EPiServer.Data.Providers.SqlDatabaseHandler.Execute(Func`1 action) +214
   EPiServer.Data.Providers.SqlDatabaseHandler.Execute(Action action) +157
   EPiServer.Initialization.CmsDataInitialization.Initialize(InitializationEngine context) +259
   EPiServer.Framework.Initialization.<>c__DisplayClass5.b__4() +56
   EPiServer.Framework.Initialization.ModuleNode.Execute(Action a, String key) +73
   EPiServer.Framework.Initialization.ModuleNode.Initialize(InitializationEngine context) +141
   EPiServer.Framework.Initialization.InitializationEngine.InitializeModules() +445
   EPiServer.Framework.Initialization.InitializationEngine.Initialize(HostType hostType) +256
   EPiServer.Framework.Initialization.InitializationModule.Initialize(HostType hostType) +342
   EPiServer.Framework.Initialization.InitializationModule.FrameworkInitialization(HostType hostType) +78
   EPiServer.Global..ctor() +83
   EPiServeMenu.EPiServerApplication..ctor() +42
   ASP.global_asax..ctor() in c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\91c4c8eb\97de0eb3\App_global.asax.0.cs:0

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) +0
   System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +113
   System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +232
   System.Activator.CreateInstance(Type type, Boolean nonPublic) +83
   System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark) +1136
   System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +128
   System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture) +18
   System.Web.HttpRuntime.CreateNonPublicInstance(Type type, Object[] args) +60
   System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +260
   System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +296

[HttpException (0x80004005): Exception has been thrown by the target of an invocation.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9873912
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254
#88561
Jul 17, 2014 8:46
Vote:
 

make sure that you are connected to correct database. You can also check if the db has this sp through sql server managment studio.

#88562
Jul 17, 2014 9:06
Vote:
 

Hi Prachi,

I had a similar problem just the other day. I connected to an external database with a database user with limited rights. I don¨t know if this will solve your problem but a gave that user execute rights.

In your SQL manager query windows, try running the following command on master:

GRANT EXECUTE ON [sp_DatabaseVersion] TO [your_EPi_db_user]

There might be a another solution, but this helped me.

Br

Marcello

#88563
Jul 17, 2014 9:08
Vote:
 

@Marcello - master does not contain this SP.  Cannot find the object 'sp_DatabaseVersion', because it does not exist or you do not have permission.

@Ahsan - Database is not created in this case. In App_Data, mdf file is created but on DB server database is not created.

            

I think this is happening due to permissions.

Please help.

#88567
Jul 17, 2014 11:06
Vote:
 

@Marcello - master does not contain this SP.  Cannot find the object 'sp_DatabaseVersion', because it does not exist or you do not have permission.

@Ahsan - Database is not created in this case. In App_Data, mdf file is created but on DB server database is not created.

            

I think this is happening due to permissions.

Please help.

#88568
Jul 17, 2014 11:07
Vote:
 

Hi, have you tried to run Update-EPiDatabase in the package manager with your web-project selected?

If you manually want to recreate the database you can have a look at http://penguinoid.com/?p=308

BR

Marcello

#88569
Edited, Jul 17, 2014 11:36
Vote:
 

Do you have an episerver database connected to your project? Make sure your connectionstring is using the correct db. When you create a new project in VS you will get a db in the AppData folder.

If you do not have that db or would like to have a db on your sql server, run the install empty db script with EPiServer Deployment Center, then you can connect your solution to that db instead and you should be up and running.

Also make sure your user in connectionstring.config is created and has accessright to read/modify that db. Usually the user is set to owner in the specific DB.

The MDF-file is the database and can be manually exported and setup in a SQL server if you like to. If you look at an ordinary DB in sql server it has two files, one MDF- and one log-file

#88571
Jul 17, 2014 13:40
Vote:
 

Thanks Eric.

#88623
Jul 21, 2014 10:46
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.