Problem with Stratframe ASP.Net Web Example


Author
Message
John Davies
John Davies
StrataFrame Beginner (13 reputation)StrataFrame Beginner (13 reputation)StrataFrame Beginner (13 reputation)StrataFrame Beginner (13 reputation)StrataFrame Beginner (13 reputation)StrataFrame Beginner (13 reputation)StrataFrame Beginner (13 reputation)StrataFrame Beginner (13 reputation)StrataFrame Beginner (13 reputation)
Group: Forum Members
Posts: 13, Visits: 136
Hi,

I wonder if you can help ... I was working through your Web sample ... and now I keep getting the error below when I click on a page that access the Strataframe database, Remote connections are enabled.  Can you help ?  I have SQL 2000 installed and SQL Express.  In my global asax file I added the connection string

DataLayer.DataSources.Add(new SqlDataSourceItem("", "Server = ./SqlExpress;Database=StrataFrameSample;Integrated Security=SSPI"));

.... although I don't believe I need it.  I have also successfully connected to the database using the Database connection Tool.

Error
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 127:Line 128://-- Execute the commandLine 129:Customers.FillDataTable(loCommand);Line 130:Line 131://-- Stop the watch


Source File: e:\Program Files\MicroFour\StrataFrame\CSharp Samples\Web Sample\SearchCustomers.aspx.cs    Line: 129

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)] 


Replies
Ivan George Borges
Ivan George Borges
Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Hi John.

Just a guess, but have you tried changing this "./SqlExpress" to something like "YourMachineName/SqlExpress" ?

Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
although I don't believe I need it.  I have also successfully connected to the database using the Database connection Tool.

Actually you DO need it.  This is the connection string that establishes the connection for the application.  First, it looks like you are trying to use a named pipe, which is OK, but you need to ensure that you have permissions for this.  You are trying to connect using integrated security which is probably not going to allow named pipes through a web session be default so you would want to connect using a user name and password. 

Secondly, you said that you were using SQL 2000, but the error message indicates that you are using SQL Server 2005 and Express wasn't a 2000 product the replacement for MSDE thus the new name in 2005...so I am pretty confident you are running 2005 Express.

Finally, the message that you provided is spot on accurate when a connection fails as this is not a message that we generate.  Most times it is best to use a connection that provides a user name and password and uses TCP versus named pipes when coming from a web application:

server=localhost\SQLEXPRESS;user id=sa;password=MyPassword;database=StrataFrameSample

Try something along those lines and see if you have better luck. Smile

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
John Davies - 17 Years Ago
Ivan George Borges - 17 Years Ago
Trent L. Taylor - 17 Years Ago
John Davies - 17 Years Ago
StrataFrame Team - 17 Years Ago
John Davies - 17 Years Ago
Trent L. Taylor - 17 Years Ago
John Davies - 17 Years Ago
Trent L. Taylor - 17 Years Ago
John Davies - 17 Years Ago
Trent L. Taylor - 17 Years Ago
John Davies - 17 Years Ago
John Davies - 17 Years Ago
Trent L. Taylor - 17 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search