ADO.net Orcas Samples Install Problem

C

csharp

I installed the August CTP, after the LINQ Preview. Everything
installs correctly. I opened the solution in VS2005 and built it,
everything compiled. I mapped a virtual directory to the installation
folder of the webapp sample (on my machine - 'C:\Program
Files\Microsoft SDKs\ADO.NET vNext CTP\Samples\CSharp\WebAppSample')

The first time I try to access the sample it takes a long time, then
errors out to this :




An error has occurred while establishing a connection to the server.
When connecting to SQL Server 2005, this failure may be caused by the
fact that under the default settings SQL Server does not 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: An error has
occurred while establishing a connection to the server. When
connecting to SQL Server 2005, this failure may be caused by the fact
that under the default settings SQL Server does not allow remote
connections. (provider: Named Pipes Provider, error: 40 - Could not
open a connection to SQL Server)

Source Error:

Line 78: using(var con = new
System.Data.SqlClient.SqlConnection(sqlb.ConnectionString)) {
Line 79: try {
Line 80: con.Open();
Line 81: }
Line 82: catch(System.Data.SqlClient.SqlException ex) {


Source File: c:\Program Files\Microsoft SDKs\ADO.NET vNext
CTP\Samples\CSharp\WebAppSample\Global.asax Line: 80

Stack Trace:

[SqlException (0x80131904): An error has occurred while establishing a
connection to the server. When connecting to SQL Server 2005, this
failure may be caused by the fact that under the default settings SQL
Server does not 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) +173

System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject
stateObj) +199
System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo,
SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout,
Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean
integratedSecurity, SqlConnection owningObject) +345

System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo
serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64
timerExpire, SqlConnection owningObject) +159

System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String
host, String newPassword, Boolean redirectedUserInstance, SqlConnection
owningObject, SqlConnectionString connectionOptions, Int64 timerStart)
+406

System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection
owningObject, SqlConnectionString connectionOptions, String
newPassword, Boolean redirectedUserInstance) +184

System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity
identity, SqlConnectionString connectionOptions, Object providerInfo,
String newPassword, SqlConnection owningObject, Boolean
redirectedUserInstance) +193

System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions
options, Object poolGroupProviderInfo, DbConnectionPool pool,
DbConnection owningConnection) +502

System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection
owningConnection, DbConnectionPoolGroup poolGroup) +27

System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection
owningConnection) +49

System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection
outerConnection, DbConnectionFactory connectionFactory) +89
System.Data.SqlClient.SqlConnection.Open() +160
ASP.global_asax.InitSample() in c:\Program Files\Microsoft
SDKs\ADO.NET vNext CTP\Samples\CSharp\WebAppSample\Global.asax:80

[Exception: Failed to open an initial database connection. This initial
connection is used to attach the sample database to the SQL Server
instance if it's being used for the first time. There are two common
reasons for this: 1) you do not have a SQL Server default instance
(e.g. you're running SQL Server Express or you installed a named
instance). To fix this simply update the server name in the connection
string (in the web.config file). 2) If you're using SQL Server Express,
by default the service runs under the NETWORK SERVICE account which
doesn't have permissions to write to the Program Files directory. That
might be the cause of this error. To fix the issue, open Windows
Explorer, go to the '\Program Files\Microsoft SDKs\ADO.NET vNext
CTP\Samples\Data' directory and add NETWORK SERVICE with read-write
permissions to it. Actual error message: An error has occurred while
establishing a connection to the server. When connecting to SQL Server
2005, this failure may be caused by the fact that under the default
settings SQL Server does not allow remote connections. (provider: Named
Pipes Provider, error: 40 - Could not open a connection to SQL Server)]
ASP.global_asax.InitSample() in c:\Program Files\Microsoft
SDKs\ADO.NET vNext CTP\Samples\CSharp\WebAppSample\Global.asax:105
ASP.global_asax.Application_Start(Object sender, EventArgs e) in
c:\Program Files\Microsoft SDKs\ADO.NET vNext
CTP\Samples\CSharp\WebAppSample\Global.asax:12






--------------------------------------------------------------------------------

Version Information: Microsoft .NET Framework Version:2.0.50727.42;
ASP.NET Version:2.0.50727.210



Upon page refresh the error message changes to this :



Value cannot be null.
Parameter name: connectionString
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.ArgumentNullException: Value cannot be null.
Parameter name: connectionString

Source Error:

Line 32: /// Initialize a new Northwind object.
Line 33: /// </summary>
Line 34: public Northwind(string connectionString) :
Line 35: base(connectionString,
"NorthwindLib.Northwind")
Line 36: {


Source File: c:\Program Files\Microsoft SDKs\ADO.NET vNext
CTP\Samples\CSharp\NorthwindLib\obj\Debug\NorthwindLib.Model.cs
Line: 34

Stack Trace:

[ArgumentNullException: Value cannot be null.
Parameter name: connectionString]
System.Data.ADP.CheckArgumentNull(T value, String parameterName) +23
System.Data.Objects.ObjectContext.CreateMapConnection(String
connectionString, String defaultContainerName) +39
System.Data.Objects.ObjectContext..ctor(String connectionString,
String defaultContainerName) +16
NorthwindLib.Northwind..ctor(String connectionString) in c:\Program
Files\Microsoft SDKs\ADO.NET vNext
CTP\Samples\CSharp\NorthwindLib\obj\Debug\NorthwindLib.Model.cs:34
Products.Page_Load(Object sender, EventArgs e) in c:\Program
Files\Microsoft SDKs\ADO.NET vNext
CTP\Samples\CSharp\WebAppSample\Products.aspx.cs:24
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object
o, Object t, EventArgs e) +15
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object
sender, EventArgs e) +34
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
+1061






--------------------------------------------------------------------------------

Version Information: Microsoft .NET Framework Version:2.0.50727.42;
ASP.NET Version:2.0.50727.210







It seems the problem is that the connection string isn't being set at
all, judging by the second error mentioning it is null.

I have SQL server express, do I need to attach the northwind DB to use
it, or am I better off with a full SQL Server install. If the latter,
do I need to do anything special on install or config to get the
Northwind DB from the samples to work?



Thanks for the help, looking very forward to playing with the samples.
 
R

RobinS

I believe you will find that your problem is linked to the first
error message, not the last. Your SQLServer Express is not set up to
allow remote connections. By "remote connections", it means to let
anything connect to it, not necessarily connections from somewhere
else on the network, rather than opening up the management tool and
running queries there.

I don't know where it is in SQLServer Express. In SQLServer, that
setting is in the Surface Area Manager.

Good luck.
Robin S.
-------------------------------------------

csharp said:
I installed the August CTP, after the LINQ Preview. Everything
installs correctly. I opened the solution in VS2005 and built it,
everything compiled. I mapped a virtual directory to the installation
folder of the webapp sample (on my machine - 'C:\Program
Files\Microsoft SDKs\ADO.NET vNext CTP\Samples\CSharp\WebAppSample')

The first time I try to access the sample it takes a long time, then
errors out to this :




An error has occurred while establishing a connection to the server.
When connecting to SQL Server 2005, this failure may be caused by the
fact that under the default settings SQL Server does not 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: An error has
occurred while establishing a connection to the server. When
connecting to SQL Server 2005, this failure may be caused by the fact
that under the default settings SQL Server does not allow remote
connections. (provider: Named Pipes Provider, error: 40 - Could not
open a connection to SQL Server)

Source Error:

Line 78: using(var con = new
System.Data.SqlClient.SqlConnection(sqlb.ConnectionString)) {
Line 79: try {
Line 80: con.Open();
Line 81: }
Line 82: catch(System.Data.SqlClient.SqlException ex) {


Source File: c:\Program Files\Microsoft SDKs\ADO.NET vNext
CTP\Samples\CSharp\WebAppSample\Global.asax Line: 80

Stack Trace:

[SqlException (0x80131904): An error has occurred while establishing a
connection to the server. When connecting to SQL Server 2005, this
failure may be caused by the fact that under the default settings SQL
Server does not 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) +173

System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject
stateObj) +199
System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo,
SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout,
Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean
integratedSecurity, SqlConnection owningObject) +345

System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo
serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64
timerExpire, SqlConnection owningObject) +159

System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String
host, String newPassword, Boolean redirectedUserInstance,
SqlConnection
owningObject, SqlConnectionString connectionOptions, Int64 timerStart)
+406

System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection
owningObject, SqlConnectionString connectionOptions, String
newPassword, Boolean redirectedUserInstance) +184

System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity
identity, SqlConnectionString connectionOptions, Object providerInfo,
String newPassword, SqlConnection owningObject, Boolean
redirectedUserInstance) +193

System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions
options, Object poolGroupProviderInfo, DbConnectionPool pool,
DbConnection owningConnection) +502

System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection
owningConnection, DbConnectionPoolGroup poolGroup) +27

System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection
owningConnection) +49

System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection
outerConnection, DbConnectionFactory connectionFactory) +89
System.Data.SqlClient.SqlConnection.Open() +160
ASP.global_asax.InitSample() in c:\Program Files\Microsoft
SDKs\ADO.NET vNext CTP\Samples\CSharp\WebAppSample\Global.asax:80

[Exception: Failed to open an initial database connection. This
initial
connection is used to attach the sample database to the SQL Server
instance if it's being used for the first time. There are two common
reasons for this: 1) you do not have a SQL Server default instance
(e.g. you're running SQL Server Express or you installed a named
instance). To fix this simply update the server name in the connection
string (in the web.config file). 2) If you're using SQL Server
Express,
by default the service runs under the NETWORK SERVICE account which
doesn't have permissions to write to the Program Files directory. That
might be the cause of this error. To fix the issue, open Windows
Explorer, go to the '\Program Files\Microsoft SDKs\ADO.NET vNext
CTP\Samples\Data' directory and add NETWORK SERVICE with read-write
permissions to it. Actual error message: An error has occurred while
establishing a connection to the server. When connecting to SQL
Server
2005, this failure may be caused by the fact that under the default
settings SQL Server does not allow remote connections. (provider:
Named
Pipes Provider, error: 40 - Could not open a connection to SQL
Server)]
ASP.global_asax.InitSample() in c:\Program Files\Microsoft
SDKs\ADO.NET vNext CTP\Samples\CSharp\WebAppSample\Global.asax:105
ASP.global_asax.Application_Start(Object sender, EventArgs e) in
c:\Program Files\Microsoft SDKs\ADO.NET vNext
CTP\Samples\CSharp\WebAppSample\Global.asax:12






--------------------------------------------------------------------------------

Version Information: Microsoft .NET Framework Version:2.0.50727.42;
ASP.NET Version:2.0.50727.210



Upon page refresh the error message changes to this :



Value cannot be null.
Parameter name: connectionString
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.ArgumentNullException: Value cannot be null.
Parameter name: connectionString

Source Error:

Line 32: /// Initialize a new Northwind object.
Line 33: /// </summary>
Line 34: public Northwind(string connectionString) :
Line 35: base(connectionString,
"NorthwindLib.Northwind")
Line 36: {


Source File: c:\Program Files\Microsoft SDKs\ADO.NET vNext
CTP\Samples\CSharp\NorthwindLib\obj\Debug\NorthwindLib.Model.cs
Line: 34

Stack Trace:

[ArgumentNullException: Value cannot be null.
Parameter name: connectionString]
System.Data.ADP.CheckArgumentNull(T value, String parameterName) +23
System.Data.Objects.ObjectContext.CreateMapConnection(String
connectionString, String defaultContainerName) +39
System.Data.Objects.ObjectContext..ctor(String connectionString,
String defaultContainerName) +16
NorthwindLib.Northwind..ctor(String connectionString) in c:\Program
Files\Microsoft SDKs\ADO.NET vNext
CTP\Samples\CSharp\NorthwindLib\obj\Debug\NorthwindLib.Model.cs:34
Products.Page_Load(Object sender, EventArgs e) in c:\Program
Files\Microsoft SDKs\ADO.NET vNext
CTP\Samples\CSharp\WebAppSample\Products.aspx.cs:24
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object
o, Object t, EventArgs e) +15
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object
sender, EventArgs e) +34
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
+1061






--------------------------------------------------------------------------------

Version Information: Microsoft .NET Framework Version:2.0.50727.42;
ASP.NET Version:2.0.50727.210







It seems the problem is that the connection string isn't being set at
all, judging by the second error mentioning it is null.

I have SQL server express, do I need to attach the northwind DB to use
it, or am I better off with a full SQL Server install. If the latter,
do I need to do anything special on install or config to get the
Northwind DB from the samples to work?



Thanks for the help, looking very forward to playing with the samples.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top