Hello,
I'm a newbie here and was wondering anyone could help me with this.
I have a simple ASP.NET 2 web application running perfectly fine with
IIS and SQLServerExpress installed locally on my WinXP as a testing
server (I created the app in Visual Studio.NET 2005).
When deploying this app on the production server (running Win2000
Server, IIS and SQLServerExpress 2005), I'm getting the following
message when calling an aspx data-bound page from a browser:
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)
On the production server, I have the SQLServerExpress installed locally
on C: drive and the database is located on D: drive (on the same
directory as the app).
Connection string used in the webconfig file:
connectionString=" Server=SERVERNAME\SQLEXPRESS;AttachDbFil
ename=D:\Inetpub\A
pp_Data\registration. mdf;Database=registration;Trusted_Connec
tion=yes;"
providerName="System.Data.SqlClient"
Does anyone know how to solve this issue? Any help would be greatly
appreciated.
Thanks,
HarryHi
Have you checked if you are allowing remote connections on your SQL Express
installation, by default these will be switched off.
Check the Remote Connections setting the the SQL Server 2005 Surface Aread
Configuration tool.
John
"hko" wrote:
> Hello,
> I'm a newbie here and was wondering anyone could help me with this.
> I have a simple ASP.NET 2 web application running perfectly fine with
> IIS and SQLServerExpress installed locally on my WinXP as a testing
> server (I created the app in Visual Studio.NET 2005).
> When deploying this app on the production server (running Win2000
> Server, IIS and SQLServerExpress 2005), I'm getting the following
> message when calling an aspx data-bound page from a browser:
> 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)
> On the production server, I have the SQLServerExpress installed locally
> on C: drive and the database is located on D: drive (on the same
> directory as the app).
> Connection string used in the webconfig file:
> connectionString=" Server=SERVERNAME\SQLEXPRESS;AttachDbFil
ename=D:\Inetpub
\App_Data\registration. mdf;Database=registration;Trusted_Connec
tion=yes;"
> providerName="System.Data.SqlClient"
> Does anyone know how to solve this issue? Any help would be greatly
> appreciated.
> Thanks,
> Harry|||Hi John,
I did allow remote connections eventhough my database is on the same machine
as my web app, but no luck so far.
I used windows authentication for the database, and login to the machine
using admin account.
Another thing that I noticed is that when I go to SQL Server Configuration
Manager, under SQL Server 2005 Network Configuration, it says Protocols for
MSSQLSERVER, whereas on my dev machine it says SQLEXPRESS. When upgrading
from MSDE to SQLExpress i just chose the default instance name, but somehow
it's saying MSSQLSERVER.
I checked the databaseconnection through SQL Management Studio Express and
it works fine. Only when viewing the data-bound page on a browser that I get
the error message.
Do you think I should try to uninstall SQLServer Express and reinstall?
hko
"John Bell" wrote:
> Hi
> Have you checked if you are allowing remote connections on your SQL Expres
s
> installation, by default these will be switched off.
> Check the Remote Connections setting the the SQL Server 2005 Surface Aread
> Configuration tool.
> John
> "hko" wrote:
>|||Hi
If this is the default instance then change your connection string to only
be the servername.
If you want to change the installation from being the default instance you
will need to re-install.
John
"hko" wrote:
> Hi John,
> I did allow remote connections eventhough my database is on the same machi
ne
> as my web app, but no luck so far.
> I used windows authentication for the database, and login to the machine
> using admin account.
> Another thing that I noticed is that when I go to SQL Server Configuration
> Manager, under SQL Server 2005 Network Configuration, it says Protocols fo
r
> MSSQLSERVER, whereas on my dev machine it says SQLEXPRESS. When upgrading
> from MSDE to SQLExpress i just chose the default instance name, but someho
w
> it's saying MSSQLSERVER.
> I checked the databaseconnection through SQL Management Studio Express and
> it works fine. Only when viewing the data-bound page on a browser that I g
et
> the error message.
> Do you think I should try to uninstall SQLServer Express and reinstall?
> hko
> "John Bell" wrote:
>|||I only have one instance and that is the default instance, and this is my
connection string:
connectionString=" Server=HOMER\SQLEXPRESS;AttachDbFilename
=D:\Inetpub\App_Da
ta\registration. mdf;Database=registration;Trusted_Connec
tion=yes;"
providerName="System.Data.SqlClient"
Still something isn't right. Do you think I should probably re-install and
do fresh installation of SQL Express instead of upgrading (like what I did)?
"John Bell" wrote:
> Hi
> If this is the default instance then change your connection string to only
> be the servername.
> If you want to change the installation from being the default instance you
> will need to re-install.
> John
>
> "hko" wrote:
>|||Hi
Try the connection string:
connectionString=" Server=HOMER;AttachDbFilename=D:\Inetpub
\App_Data\registra
tion. mdf;Database=registration;Trusted_Connec
tion=yes;"
providerName="System.Data.SqlClient"
If you want a names instance then you would have to re-install and say that
you want a named instance and not the default instance.
John
"hko" wrote:
> I only have one instance and that is the default instance, and this is my
> connection string:
> connectionString=" Server=HOMER\SQLEXPRESS;AttachDbFilename
=D:\Inetpub\App_
Data\registration. mdf;Database=registration;Trusted_Connec
tion=yes;"
> providerName="System.Data.SqlClient"
> Still something isn't right. Do you think I should probably re-install and
> do fresh installation of SQL Express instead of upgrading (like what I did
)?
> "John Bell" wrote:
>|||Still not working. I tried different combination of connection strings but
kept getting the same error message.
I just want to use the default instance since there's only one database on
the machine.
I suspect there's a glitch during the upgrade process which causes SQL
server to locate the default instance. I was able to connect ok using
Management Studio Express.
This is the most frustrating thing ever to deal with...
"John Bell" wrote:
> Hi
> Try the connection string:
> connectionString=" Server=HOMER;AttachDbFilename=D:\Inetpub
\App_Data\regist
ration. mdf;Database=registration;Trusted_Connec
tion=yes;"
> providerName="System.Data.SqlClient"
> If you want a names instance then you would have to re-install and say tha
t
> you want a named instance and not the default instance.
> John
> "hko" wrote:
>|||Hi
A couple of suggestions:
Try using osql to try and connect, use both the server name and the IP
address and different user combinations.
Check that there is no blocking of the ports being used by a firewall (Try
telneting to the port!)
John
"hko" wrote:
> Still not working. I tried different combination of connection strings but
> kept getting the same error message.
> I just want to use the default instance since there's only one database on
> the machine.
> I suspect there's a glitch during the upgrade process which causes SQL
> server to locate the default instance. I was able to connect ok using
> Management Studio Express.
> This is the most frustrating thing ever to deal with...
> "John Bell" wrote:
>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment