ADO.net Orcas Samples Install Problem



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.

.



Relevant Pages

  • Re: VS 2008 Team - Database not supported / Cant load file or ass
    ... Visual Studio 2008 Team Database Edition ... SQL Server 2005 Enterprise SP2 ... Unable to add data connection. ... Install the following from Microsoft SQL Server 2008 Feature Pack RC0, ...
    (microsoft.public.vstudio.general)
  • Re: Custom membership provider problem
    ... SQL server 2005 does not install with the TCP/IP protocol turned on. ... >An error has occurred while establishing a connection to the server. ... 25 - Connection string is not valid) ... >Boolean& failoverDemandDone, String host, String failoverPartner, String ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: TdsParser failures
    ... I don't recommend using a WAN connection for SQL Server. ... Hitchhiker's Guide to Visual Studio and SQL Server ... exception, Boolean breakConnection) ... RunBehavior runBehavior, String resetOptionsString) ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Connection to SQL Server from within the emulator - newbie que
    ... 'Personal' edition of SQL Server 2000 installed. ... using the IP address with another application apart from the emulator? ... to install it, then use ipconfig.exe to see what IP address the loopback ... connection but is not plugged into a physical network connection. ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Help Please Wit Error
    ... Occasionally I receive the error you are mentioning when the SQL Server ... I have had to completely remove the MDAC and re-install it as well ... see an example of the connection string you are using. ... Please install Microsoft Data Access Components ...
    (microsoft.public.dotnet.csharp.general)