Dewald Viljoen


Hi

I have built a site in Visual Web developer Express 2005. it works fine on my local machine but when I load it up to the server I get the following 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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

My connectionstring in my web config file:

<add name="ConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated Security=True;User Instance=True"

providerName="System.Data.SqlClient" />

I have enabled remote connections with TCP/IP only on my sql express SAC

I.ve tried hours to resolve this problem, Please help.




Re: Upload a Sql website to a host server

Jens K. Suessmeyer


Hi,

did you restart the service for applying the settings


HTH, Jens K. Suessmeyer.

---
http://www.sqlserver2005.de
---





Re: Upload a Sql website to a host server

Dewald Viljoen

Yes I did

But it still does not work

 






Re: Upload a Sql website to a host server

Jens K. Suessmeyer

Hi,

make also sure that either SQL Browser is started on the machine or you specify the port SQL Server Express is running in (but preferable to use SQL Browser as the port will be assigned dynamically and can change after the next service restart).

HTH, Jens K. Suessmeyer.

---
http://www.sqlserver2005.de
---




Re: Upload a Sql website to a host server

Dewald Viljoen

I just want to clarify.

It works fine on my local machine but I get the error if I upload it to the server and then try to run it. Will these changes make any diffeence with that





Re: Upload a Sql website to a host server

Jens K. Suessmeyer

Yes, they will.



Re: Upload a Sql website to a host server

Dewald Viljoen

OK

I verified that the SQl Server Browser is running under the SAC panel, then build and uploaded the application again.

I get the same error message





Re: Upload a Sql website to a host server

Jens K. Suessmeyer

YOu started the remote SQL browser service, right



Re: Upload a Sql website to a host server

Dewald Viljoen

Well I am not to sure about that.

On the SAC window

under SQL server browser there is one service listed :

SQLBrowser

It does not say anything about remote.Under SQLEXPRESS remote connetions is set to local and remote with TCP/IP





Re: Upload a Sql website to a host server

Mark Fitz

You did make sure that the host server has sql server express support correct A lot of people make this mistake and it's very easy to do. Even if the host supports SQL Server it doesn't mean they support SQL Server Express. Also make sure that if they do support it, there isn't a switch in your admin panel that is required to set it up. It could be there, but disabled by default.



Re: Upload a Sql website to a host server

Dewald Viljoen

Well indeed

Go daddy does not support Express on their shared hosting accounts. What a pain...

Thank you very very much for you help.





Re: Upload a Sql website to a host server

Ken Tucker

Use the Sql Server Hosting toolkit to get your database to go daddy. Scott Guthrie has nice blog entry about it.





Re: Upload a Sql website to a host server

Dewald Viljoen

THANKS ! That  helped a lot.

 

I compiled a sql script(with the data publihing wizard) and ran it at my hosts database quiry to import it to the database but got the following error

Line 5: Incorrect syntax near 'ROLE'.

/****** Object:  Role [aspnet_Membership_BasicAccess]    Script Date: 02/01/2007 22:45:36 ******/
IF NOT EXISTS (SELECT * FROM sys.database_principals WHERE name = N'aspnet_Membership_BasicAccess')
BEGIN
IF NOT EXISTS (SELECT * FROM sys.database_principals WHERE name = N'aspnet_Membership_BasicAccess' AND type = 'R')
CREATE ROLE [aspnet_Membership_BasicAccess] AUTHORIZATION [dbo]

END

Can anyone help 1





Re: Upload a Sql website to a host server

oj

try:

IF NOT EXISTS (SELECT * FROM sys.database_principals WHERE name = N'aspnet_Membership_BasicAccess' AND type = 'R')
BEGIN
CREATE ROLE [aspnet_Membership_BasicAccess] AUTHORIZATION [dbo]
END
go