sql error

Topics: Installing Orchard
Jan 1, 2012 at 12:10 PM

I'm wondering if someone can help me with the below error from my provider?

Where should i start looking?

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

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: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

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: 

[SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)]
   System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +5050218
   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning() +234
   System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity) +341
   System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, SqlConnection owningObject) +129
   System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, TimeoutTimer timeout) +239
   System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, TimeoutTimer timeout, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +195
   System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +232
   System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +185
   System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +33
   System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +524
   System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66
   System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +479
   System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +108
   System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +126
   System.Data.SqlClient.SqlConnection.Open() +125
   NHibernate.Connection.DriverConnectionProvider.GetConnection() +104
   NHibernate.Tool.hbm2ddl.SuppliedConnectionProviderConnectionHelper.Prepare() +15
   NHibernate.Tool.hbm2ddl.SchemaMetadataUpdater.GetReservedWords(Dialect dialect, IConnectionHelper connectionHelper) +89
   NHibernate.Tool.hbm2ddl.SchemaMetadataUpdater.Update(ISessionFactory sessionFactory) +80
   NHibernate.Impl.SessionFactoryImpl..ctor(Configuration cfg, IMapping mapping, Settings settings, EventListeners listeners) +599
   NHibernate.Cfg.Configuration.BuildSessionFactory() +104
   Orchard.Data.SessionFactoryHolder.BuildSessionFactory() in SessionFactoryHolder.cs:83
   Orchard.Data.SessionFactoryHolder.GetSessionFactory() in SessionFactoryHolder.cs:61
   Orchard.Data.SessionLocator.For(Type entityType) in SessionLocator.cs:29
   Orchard.Data.Repository`1.get_Session() in Repository.cs:26
   Orchard.Data.Repository`1.get_Table() in Repository.cs:30
   Orchard.Data.Repository`1.Fetch(Expression`1 predicate) in Repository.cs:126
   Orchard.Data.Repository`1.Get(Expression`1 predicate) in Repository.cs:91
   Orchard.Data.Repository`1.Orchard.Data.IRepository<T>.Get(Expression`1 predicate) in Repository.cs:60
   Orchard.Core.Settings.Descriptor.ShellDescriptorManager.GetDescriptorRecord() in ShellDescriptorManager.cs:57
   Orchard.Core.Settings.Descriptor.ShellDescriptorManager.GetShellDescriptor() in ShellDescriptorManager.cs:30
   Orchard.Environment.ShellBuilders.ShellContextFactory.CreateShellContext(ShellSettings settings) in ShellContextFactory.cs:66
   Orchard.Environment.DefaultOrchardHost.CreateShellContext(ShellSettings settings) in DefaultOrchardHost.cs:168
   Orchard.Environment.DefaultOrchardHost.CreateAndActivateShells() in DefaultOrchardHost.cs:132
   Orchard.Environment.DefaultOrchardHost.BuildCurrent() in DefaultOrchardHost.cs:103
   Orchard.Environment.DefaultOrchardHost.Orchard.Environment.IOrchardHost.Initialize() in DefaultOrchardHost.cs:67
   Orchard.Web.MvcApplication.HostInitialization(HttpApplication application) in Global.asax.cs:48
   Orchard.WarmupStarter.<>c__DisplayClass3.<LaunchStartupThread>b__2(Object state) in Starter.cs:89

[ApplicationException: Error during application initialization]
   Orchard.WarmupStarter.Starter`1.OnBeginRequest(HttpApplication application) in Starter.cs:63
   Orchard.Web.MvcApplication.Application_BeginRequest() in Global.asax.cs:29

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner) +0
   System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner) +72
   System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) +335
   System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +28
   System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) +19
   System.Web.Util.ArglessEventHandlerProxy.Callback(Object sender, EventArgs e) +57
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +148
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

Jan 1, 2012 at 2:44 PM
chocbudda wrote:

Where should i start looking?

Your connection string is likely wrong or the configuration on the SQL server isn't right.  What's your SQL connection string look like?

Jan 2, 2012 at 4:07 AM

Currently have this:       

<add connectionString="Data Source=wacorcharduser.db.8674916.hostedresource.com; Initial Catalog=wacorcharduser; User ID=wacorcharduser; Password=somesecret;"/>

Jan 2, 2012 at 4:27 AM
Edited Jan 2, 2012 at 4:27 AM
chocbudda wrote:

Currently have this:       

<add connectionString="Data Source=wacorcharduser.db.8674916.hostedresource.com; Initial Catalog=wacorcharduser; User ID=wacorcharduser; Password=somesecret;"/>

And I assume that you are able to connect to it in visual studio or sql studio express?

 

http://corecomps.info/help/connection.png

Jan 2, 2012 at 10:07 AM

confirmed: i can connect from visual studio, server explorer with this connection string although the dev environment uses the local copy

Jan 2, 2012 at 3:16 PM
chocbudda wrote:

confirmed: i can connect from visual studio, server explorer with this connection string although the dev environment uses the local copy

Okay so which environment is having the issue?  Dev or Prod?  What string are you using locally and what string are you using for "production"?

Jan 2, 2012 at 4:03 PM

You realise the connection string should be in Settings.txt not Web.config?

Jan 2, 2012 at 8:47 PM

That’s where orchard placed it… but ill take a look

Jan 2, 2012 at 8:51 PM

Its only production that is having the issue and im manually altering the connection string from the dev version

<add connectionString="Trusted_Connection=True;Server=MICHAEL-DELL;Database=WacOrchardDB" name="WacOrchardDB" providerName="System.Data.SqlClient" />

Once it is on the production server to the string above.

I used webmatrix so am unfamiliar with how to set a dev and release version, im currently in the process of moving this project to visual studio

BTW:

I Appreciate your help

Coordinator
Jan 2, 2012 at 8:57 PM

No, Orchard never touches web.config. Maybe WebMatrix?

Really, you should be looking at settings.txt, not web.config.

Jan 2, 2012 at 9:29 PM

Ok im searching (via ftp on the website) for settings.txt…. any clues?

Coordinator
Jan 2, 2012 at 9:33 PM

app_data/sites/default

Jan 2, 2012 at 10:02 PM

A quick reply to say that worked (of course)…damn confusing having a webconfig though…

Thanks again

Michael

Jan 2, 2012 at 10:04 PM

Glad you got it....the webconfig doesn't work when you have multiple sites...

--------
John
Sent from a mobile phone

On Jan 2, 2012 4:02 PM, "chocbudda" <notifications@codeplex.com> wrote:

From: chocbudda

A quick reply to say that worked (of course)…damn confusing having a webconfig though…

Thanks again

Michael

Read the full discussion online.

To add a post to this discussion, reply to this email (orchard@discussions.codeplex.com)

To start a new discussion for this project, email orchard@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com