Showing posts with label website. Show all posts
Showing posts with label website. Show all posts

Thursday, March 8, 2012

Connection to SQL Server 2000 thinks it is 2005

Hi
I have a SQL Server 2000 database that I can connect to from an ASP.NET web
site quite happily. Using the same connection string in a Windows Forms
application I get the message "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").
Please could anyone advise.
Marek
Hi
It does not think it is SQL Server 2005 ("when"), but gives additional
information, in case you are trying to connect to SQL Server 2005. Part of
the enhanced error information that helps with troubleshooting.
Have you tried connecting though TCP/IP (adding "Network Library=DBMSSOCN"
to your connection string)?
You web server might be configured differently. Running cliconfg.exe on your
machine will allow you to configure the default library.
Regards
Mike
This posting is provided "AS IS" with no warranties, and confers no rights.
"Marek" <mav@.community.nospam> wrote in message
news:B89D86BB-AF20-4E90-89AE-C690A07BC232@.microsoft.com...
> Hi
> I have a SQL Server 2000 database that I can connect to from an ASP.NET
> web
> site quite happily. Using the same connection string in a Windows Forms
> application I get the message "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").
> Please could anyone advise.
> Marek

Connection to SQL Server 2000 thinks it is 2005

Hi
I have a SQL Server 2000 database that I can connect to from an ASP.NET web
site quite happily. Using the same connection string in a Windows Forms
application I get the message "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: 4
0
- Could not open a connection to SQL Server").
Please could anyone advise.
MarekHi
It does not think it is SQL Server 2005 ("when"), but gives additional
information, in case you are trying to connect to SQL Server 2005. Part of
the enhanced error information that helps with troubleshooting.
Have you tried connecting though TCP/IP (adding "Network Library=DBMSSOCN"
to your connection string)?
You web server might be configured differently. Running cliconfg.exe on your
machine will allow you to configure the default library.
Regards
--
Mike
This posting is provided "AS IS" with no warranties, and confers no rights.
"Marek" <mav@.community.nospam> wrote in message
news:B89D86BB-AF20-4E90-89AE-C690A07BC232@.microsoft.com...
> Hi
> I have a SQL Server 2000 database that I can connect to from an ASP.NET
> web
> site quite happily. Using the same connection string in a Windows Forms
> application I get the message "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").
> Please could anyone advise.
> Marek

Connection to SQL Server 2000 From an ASP Page

Dear All,
I'm really confusing while reading the connections Issue in the support
knowledge.
Our Company website guest users can register themselves in my website. The
data goes to the SQL Server database 2000 which also used by internal users
of my company as Inhouse Database. So I want to restrict the Website Guest
users. Whats the safest way to connect to?.
Actually MY IIS SQL Server running on different machine(as stated in
support base)
1. I have created windows user a/c (say WEBUSER) on both machines with the
same password.
2. I have created a login a/c SQL Server for WEBUSER too.
But unfortunately I am getting "Internal Server Error" - Page Can not be
Displayed.
My connection String is as follows:
dc0.Open "Provider=sqloledb;" & _
"Network Library=DBNETLIB;" & _
"Integrated Security=SSPI." & _
"Data Source=ServerName;" & _
"Initial Catalog=DatabaseName;" & _
"User ID=UserName;" & _
"Password=password"
Please advice me is this safe?. Why I'm getting the error?
Thanks
Kavi
As a first step, try the following:
Log onto SQL Query Analyser and log on with the DataSource/username/password
that is used withing your connection string.
If this is OK , simulate a SQL statement that is similar that will run by a
web user.
At this point, you'll know that the account is OK.
can you connect , for example, via telnet to the sql server?
Are other pages running on the web server.
Also, see if you can trap the error and print it on the page.
Jack Vamvas
___________________________________
Receive free SQL tips - www.ciquery.com/sqlserver.htm
"Kavi" <Kavi@.discussions.microsoft.com> wrote in message
news:FA375A40-B27B-44DE-9584-7CC8B781AFE1@.microsoft.com...
> Dear All,
> I'm really confusing while reading the connections Issue in the support
> knowledge.
> Our Company website guest users can register themselves in my website. The
> data goes to the SQL Server database 2000 which also used by internal
users
> of my company as Inhouse Database. So I want to restrict the Website Guest
> users. Whats the safest way to connect to?.
> Actually MY IIS SQL Server running on different machine(as stated in
> support base)
> 1. I have created windows user a/c (say WEBUSER) on both machines with
the
> same password.
> 2. I have created a login a/c SQL Server for WEBUSER too.
> But unfortunately I am getting "Internal Server Error" - Page Can not be
> Displayed.
> My connection String is as follows:
> dc0.Open "Provider=sqloledb;" & _
> "Network Library=DBNETLIB;" & _
> "Integrated Security=SSPI." & _
> "Data Source=ServerName;" & _
> "Initial Catalog=DatabaseName;" & _
> "User ID=UserName;" & _
> "Password=password"
> Please advice me is this safe?. Why I'm getting the error?
> Thanks
> Kavi
>
|||Thanks Jack. I'll try.
"Jack Vamvas" wrote:

> As a first step, try the following:
> Log onto SQL Query Analyser and log on with the DataSource/username/password
> that is used withing your connection string.
> If this is OK , simulate a SQL statement that is similar that will run by a
> web user.
> At this point, you'll know that the account is OK.
> can you connect , for example, via telnet to the sql server?
> Are other pages running on the web server.
> Also, see if you can trap the error and print it on the page.
>
> --
> Jack Vamvas
> ___________________________________
> Receive free SQL tips - www.ciquery.com/sqlserver.htm
>
> "Kavi" <Kavi@.discussions.microsoft.com> wrote in message
> news:FA375A40-B27B-44DE-9584-7CC8B781AFE1@.microsoft.com...
> users
> the
>
>
|||In the Advanced tab of Internet Options of IE, uncheck "Show friendly
HTTP error messages". Then you usually can see the whole error
message.
Shane

Connection to SQL Server 2000 From an ASP Page

Dear All,
I'm really confusing while reading the connections Issue in the support
knowledge.
Our Company website guest users can register themselves in my website. The
data goes to the SQL Server database 2000 which also used by internal users
of my company as Inhouse Database. So I want to restrict the Website Guest
users. Whats the safest way to connect to?.
Actually MY IIS SQL Server running on different machine(as stated in
support base)
1. I have created windows user a/c (say WEBUSER) on both machines with the
same password.
2. I have created a login a/c SQL Server for WEBUSER too.
But unfortunately I am getting "Internal Server Error" - Page Can not be
Displayed.
My connection String is as follows:
dc0.Open "Provider=sqloledb;" & _
"Network Library=DBNETLIB;" & _
"Integrated Security=SSPI." & _
"Data Source=ServerName;" & _
"Initial Catalog=DatabaseName;" & _
"User ID=UserName;" & _
"Password=password"
Please advice me is this safe?. Why I'm getting the error?
Thanks
KaviAs a first step, try the following:
Log onto SQL Query Analyser and log on with the DataSource/username/password
that is used withing your connection string.
If this is OK , simulate a SQL statement that is similar that will run by a
web user.
At this point, you'll know that the account is OK.
can you connect , for example, via telnet to the sql server?
Are other pages running on the web server.
Also, see if you can trap the error and print it on the page.
Jack Vamvas
___________________________________
Receive free SQL tips - www.ciquery.com/sqlserver.htm
"Kavi" <Kavi@.discussions.microsoft.com> wrote in message
news:FA375A40-B27B-44DE-9584-7CC8B781AFE1@.microsoft.com...
> Dear All,
> I'm really confusing while reading the connections Issue in the support
> knowledge.
> Our Company website guest users can register themselves in my website. The
> data goes to the SQL Server database 2000 which also used by internal
users
> of my company as Inhouse Database. So I want to restrict the Website Guest
> users. Whats the safest way to connect to?.
> Actually MY IIS SQL Server running on different machine(as stated in
> support base)
> 1. I have created windows user a/c (say WEBUSER) on both machines with
the
> same password.
> 2. I have created a login a/c SQL Server for WEBUSER too.
> But unfortunately I am getting "Internal Server Error" - Page Can not be
> Displayed.
> My connection String is as follows:
> dc0.Open "Provider=sqloledb;" & _
> "Network Library=DBNETLIB;" & _
> "Integrated Security=SSPI." & _
> "Data Source=ServerName;" & _
> "Initial Catalog=DatabaseName;" & _
> "User ID=UserName;" & _
> "Password=password"
> Please advice me is this safe?. Why I'm getting the error?
> Thanks
> Kavi
>|||Thanks Jack. I'll try.
"Jack Vamvas" wrote:

> As a first step, try the following:
> Log onto SQL Query Analyser and log on with the DataSource/username/passwo
rd
> that is used withing your connection string.
> If this is OK , simulate a SQL statement that is similar that will run by
a
> web user.
> At this point, you'll know that the account is OK.
> can you connect , for example, via telnet to the sql server?
> Are other pages running on the web server.
> Also, see if you can trap the error and print it on the page.
>
> --
> Jack Vamvas
> ___________________________________
> Receive free SQL tips - www.ciquery.com/sqlserver.htm
>
> "Kavi" <Kavi@.discussions.microsoft.com> wrote in message
> news:FA375A40-B27B-44DE-9584-7CC8B781AFE1@.microsoft.com...
> users
> the
>
>|||In the Advanced tab of Internet Options of IE, uncheck "Show friendly
HTTP error messages". Then you usually can see the whole error
message.
Shane

Friday, February 24, 2012

Connection String Problem

I am working on a new website where the ISP (GoDaddy) has plans that include
a sql server (one db). I setup the db, built and partially populated some
tables and, from an aspx page on that account, I figured out the connection
string - works pretty well (I sure miss EM!). Now, I want to create a
windows application (desktop) to manage some aspects of that database but
the server name that works from the aspx page does not work from a windows
application. The sql server "address" is something like"
xxsql01.prod.xxxx1.secureserver.net
(Not sure if that is a name limited to the account so I "x" out parts of
it?) and there is a DB name which I use as the Initial Catalog.
Has anyone dealt with this type of server before? Any hints on how to
address it externally? I tried prefixing that address with the domain name
of the ISP account but that did not help
Appreciate any suggestions.
WayneUsing Enterprise Manager, I can register SQL Server hosted at my ISP via IP
address. Just try specifying the IP for the server name.
"Wayne Wengert" <wayneDONTWANTSPAM@.wengert.com> wrote in message
news:eW6auhuDFHA.2220@.TK2MSFTNGP09.phx.gbl...
> I am working on a new website where the ISP (GoDaddy) has plans that
include
> a sql server (one db). I setup the db, built and partially populated some
> tables and, from an aspx page on that account, I figured out the
connection
> string - works pretty well (I sure miss EM!). Now, I want to create a
> windows application (desktop) to manage some aspects of that database but
> the server name that works from the aspx page does not work from a windows
> application. The sql server "address" is something like"
> xxsql01.prod.xxxx1.secureserver.net
> (Not sure if that is a name limited to the account so I "x" out parts of
> it?) and there is a DB name which I use as the Initial Catalog.
>
> Has anyone dealt with this type of server before? Any hints on how to
> address it externally? I tried prefixing that address with the domain name
> of the ISP account but that did not help
>
> Appreciate any suggestions.
>
> Wayne
>|||Ask your provider if the SQL-Server is directly accessible from the internet
and not blocked by a firewall. Many (most ?) ISP are now blocking the port
1433 to *protect* the sql-servers from outside attacks.
Even if the SQL-Server is accessible from the outside (Internet), if there
is a proxy then the connection string might be different then the one used
for ASP.NET.
S. L.
"Wayne Wengert" <wayneDONTWANTSPAM@.wengert.com> wrote in message
news:eW6auhuDFHA.2220@.TK2MSFTNGP09.phx.gbl...
>I am working on a new website where the ISP (GoDaddy) has plans that
>include
> a sql server (one db). I setup the db, built and partially populated some
> tables and, from an aspx page on that account, I figured out the
> connection
> string - works pretty well (I sure miss EM!). Now, I want to create a
> windows application (desktop) to manage some aspects of that database but
> the server name that works from the aspx page does not work from a windows
> application. The sql server "address" is something like"
> xxsql01.prod.xxxx1.secureserver.net
> (Not sure if that is a name limited to the account so I "x" out parts of
> it?) and there is a DB name which I use as the Initial Catalog.
>
> Has anyone dealt with this type of server before? Any hints on how to
> address it externally? I tried prefixing that address with the domain name
> of the ISP account but that did not help
>
> Appreciate any suggestions.
>
> Wayne
>|||Thanks guys. I'll pursue those suggestions.
Wayne
"Sylvain Lafontaine" <sylvain aei ca (fill the blanks, no spam please)>
wrote in message news:OqUzD9uDFHA.148@.TK2MSFTNGP14.phx.gbl...
> Ask your provider if the SQL-Server is directly accessible from the
internet
> and not blocked by a firewall. Many (most ?) ISP are now blocking the
port
> 1433 to *protect* the sql-servers from outside attacks.
> Even if the SQL-Server is accessible from the outside (Internet), if there
> is a proxy then the connection string might be different then the one used
> for ASP.NET.
> S. L.
> "Wayne Wengert" <wayneDONTWANTSPAM@.wengert.com> wrote in message
> news:eW6auhuDFHA.2220@.TK2MSFTNGP09.phx.gbl...
some
but
windows
name
>

Connection string not valid !

I've build a website with asp.net and on my local machine it run very we. but when I store my website on a server, I have a error : ...error: 25 - Connection String not valid...

This is my connection string on my local machine : "add name="csIyp" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|iyapason.mdf;User Instance=true" providerName="System.Data.SqlClient" "

And the connection string on my webserver : "add name="csIyp" connectionString="data source= .\MSSQLSERVER;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|iyapason.mdf;User Instance=true" providerName="System.Data.SqlClient" "

So, what can I do to solve this probleme.

Thanks !

Does your web server have an actual SQL Server Express database engine installed, or SQL Server 2005 of some kind (as in, not Express). If the later, attaching DB on the fly like that string does might not work.|||There is a SQL Server 2005 engine installed on my webserver and i think that the instance name is "MSSQLSERVER". so can I have a sample connection string?|||

Hi siebobby,

Base on my understanding, we will not install SQL Server Express on the web server. So I think MSSQLSERVER is not an Express Edition. If my supposition is incorrect, please feel free to point out.

AttachDBFilename is used to specify the database to attach to the user instance. And User instances only work in the Express Edition of SQL Server 2005. So you must change the connect string for new SQL Server, the string may likes below:

connectionString="Data Source=.\MSSQLSERVER;Initial Catalog=iyapason;Integrated Security=True"

Be sure attaching iyapason.mdf in the MSSQLSERVER first.

Sunday, February 12, 2012

Connection Problem, MS Personal Website Starter Kit

I have had a local Website up and running based on the MS Personal Website Starter Kit using Visual Studio 2005 Professional and SQL Server Express.

I am now trying to get the databases to run on SQL Server 2005 Standard Edition but can't get the connection to work.

I have changed the connection string in the Web.Config file from:

connectionString="Data Source=.\SQLExpress;Integrated Security=True;User Instance=True;AttachDBFilename=|DataDirectory|Personal.mdf" providerName="System.Data.SqlClient"

To

connectionString="Data Source=.\scastle;Integrated Security=True;User Instance=True;AttachDBFilename=|DataDirectory|Personal.mdf" providerName="System.Data.SqlClient"

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

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

Source Error:

Line 5: Sub Application_Start(ByVal sender As [Object], ByVal e As EventArgs)

Line 6: AddHandler SiteMap.SiteMapResolve, AddressOf Me.AppendQueryString

Line 7: If (Roles.RoleExists("Administrators") = False) Then

Line 8: Roles.CreateRole("Administrators")

Line 9: End If

I am able to connect OK in both Server Management Studio (Server Name: SCastle, Windons Authentication) and clicking Connect to Database in Server Manager in Visual Studio (Server Name: (local)).

Have I got the connection string wrong or do I need to set up additional permissions in the database?

Thanks for your help.

Stephen

Hi,

the user instance feature only work with the Sql Server Express Edition. If you want to use the database with the Standard edition you will have to attach the database to the Server instance (to make it server controlled) and then change the connectionstring to the following (assuming that the local server holds an instance of the name scastle)

connectionString="Data Source=.\scastle;Integrated Security=True;Initial Catalog=YourDBnameafterattachment providerName="System.Data.SqlClient"

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de

|||

Jens

Thanks for the response. I have tried adding the following in line with your advice but still get the same error:

<connectionStrings>

<add name="Personal" connectionString="Data Source=.\scastle;Integrated Security=True;Initial Catalog=Personal" providerName="System.Data.SqlClient"/>

<remove name="LocalSqlServer"/>

<add name="LocalSqlServer" connectionString="Data Source=.\scastle;Integrated Security=True; Initial Catalog=ASPNetDB"/>

</connectionStrings>

Any idea what is wrong?

Thanks

Stephen

|||You should then also check of you enbled remote connections (see the screencast on my site for more information)

Jens K. Suessmeyer.

http://www.sqlserver2005.de
|||

Thanks again Jens.

Problem has been solved by changing Data Source from ".\scastle" to "(local)".

Stephen