Hi,
I created a simple login form and when I run it on my local machine it works ...but when I upload it to my web host it doesn't work. This is the error I get:
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)
I was told that I get this because the web host doesn't have sql express on their server. Does anyone have any ideas how to fix this....and should I just abandon using sql express in the future, or can I use sql express to make my databases and then just convert them to sql 2000 afterward?
I created a simple login form and when I run it on my local machine it works ...but when I upload it to my web host it doesn't work. This is the error I get:
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)
I was told that I get this because the web host doesn't have sql express on their server. Does anyone have any ideas how to fix this....and should I just abandon using sql express in the future, or can I use sql express to make my databases and then just convert them to sql 2000 afterward?
-
Re: Login doesn't work
Tue, May 9, 2006 - 6:39 AMSQL Server Express and SQL Server 2005 have the same code base. Either will work as a datastore for an ASP.NET application, however, you need to make sure:
a) that the web host is running SQL Server
b) that you've uploaded your tables and stored procs to the database on the web host
c) you have set up your connection string to access the database on the web host -- odds are the username and password aren't the same or that you are using windows authentication on your dev machine, this won't work on your web host database -
-
Re: Login doesn't work
Tue, May 9, 2006 - 10:52 AMThanks for the help...I have totally abandoned the SQL for now...I figured an access membership provider...which pretty much is the same as the default db that express sets up when you use vwd 2005 authentication.
-
-
Re: Login doesn't work
Tue, July 11, 2006 - 1:41 PMProblem:
(provider: SQL Network Interfaces, Error: 26 - Error locating server/instance specified)
There are several reasons for this "generic error" for example, if you are using profile variables to manage application state, using ASP built in security, or allow users to change the look and feel of the page. Anyway...
Solution:
open Visual Studio Command Prompt (Start => All Programs => Microsoft Visual Studio 2005 => Visual Studio Tools => Visual Studio Comman Prompt)
run aspnet_regsql.exe
click next
select Configure SQL Server for applications
click next
Add the server name and LEAVE the database as <default>
click next
click next
the above will create a new database called ASPNETDB
NOW DO THE FOLLOWING
On your web server, search for the file machine.config (generally found in Windows\Microsoft.net\Framwork\vx.0xxxx\config) and find/change the following line of code
<!--
comment out the following...
<add name="LocalSqlServer" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient" />
-->
<add name="LocalSqlServer" connectionString="Data Source=YOURSQLSERVER;Initial Catalog=ASPNETDB;User ID=bhammond;password=bhammond" />
By default, ASP uses SQLExpress. Comment out that line of code and add the one above (Setting appropriate properties)