Trying to get a simple webpage with SQL 2005 Express to work on my hosted site

  • Thread starter Thread starter Martin Randall
  • Start date Start date
M

Martin Randall

Hi,

I'm trying to get a simple dataview test page working on my hosted site. The hosted site runs ASP.Net 2.0, no problem. The test page works on my development machine, no problem... but when I upload the published site I get...

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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

Does anyone have any ideas on this?

Martin Randall
 
Where is the SQL Server? Is it on a seperate site?
Hi,

I'm trying to get a simple dataview test page working on my hosted site. The hosted site runs ASP.Net 2.0, no problem. The test page works on my development machine, no problem... but when I upload the published site I get...

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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

Does anyone have any ideas on this?

Martin Randall
 
Ah - sorry. The Sql Server 2005 Express file is in the App_Data folder
Where is the SQL Server? Is it on a seperate site?
Hi,

I'm trying to get a simple dataview test page working on my hosted site. The hosted site runs ASP.Net 2.0, no problem. The test page works on my development machine, no problem... but when I upload the published site I get...

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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

Does anyone have any ideas on this?

Martin Randall
 
Bad Connection string or a bad SQL Server configuration.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Show me your certification without works,
and I'll show my certification
*by* my works.

Hi,

I'm trying to get a simple dataview test page working on my hosted site. The
hosted site runs ASP.Net 2.0, no problem. The test page works on my
development machine, no problem... but when I upload the published site I
get...

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: SQL Network Interfaces, error:
26 - Error Locating Server/Instance Specified)

Does anyone have any ideas on this?

Martin Randall
 
Hmm... thought of those already. Any other ideas? Could it be that my
hosting company has badly configured SQL Express?
 
Networking protocols are disabled by default in SQL Server Express.

If someone simply installs Express and chooses all the defaults, SQL Server Express will only
be able to have connections originating on the local machine where SQL Server is installed.

You need to expressly enable networking protocols.

Follow the instructions outlined at :

http://blogs.msdn.com/sqlexpress/archive/2005/05/05/415084.aspx
and
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=271795&SiteID=1



Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
 
Hi - thanks for the pointer, but I'm not sure if that is relevent. Is it
something that my hosting company will have to sort out?
 
re:
I'm not sure if that is relevent.

Let me say it another way :

If the networking protocols are not enabled,
*nobody* can connect to SQL Server Expres from outside the bix SSE is running in.

Is that clearer now ?
Did you read the information in the links I provided for you ?

re:
Is it something that my hosting company will have to sort out?

YEs. They have to enable SSE's networking protocols,
by following the instructions in the articles I sent you.

Request that they do that, and send them the article.
They might not be aware of what they have to do ( as apperently thay aren't ).




Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
 
No it is not clear...

Having a similar issue, let me re-state the question to be more clear
on my end...

I have developed and ASP.NET 2.0 Site in visual Studio 2005. I set up
the security, defined roles e.t.c.
I did not set-up any SQL server, including the SQL server Express on my
development box.
ASP.NET 2.0 created this MDF file in the APP_Data folder for me and
took care of the connection.
This default connection string is not even visible in the config file.

I did not do any settings AT ALL, including network protocols, SQL
server express settings whatsoever...

Then I PUBLISHed this site to my hosted server.

and I am getting this very same error

Isn't it supposed to work ?

My hosted site supports asp.net 2.0

Do I nned anything other than that?

Thanks in advance
 
Back
Top