Showing posts with label config. Show all posts
Showing posts with label config. Show all posts

Thursday, March 22, 2012

connecting to SQL 2000 Server gives SQL 2005 error message

Hi,

Here is the syntax of the connection string within the web.config file:

<connectionStrings>
<clear />

<addname="MyConnectionString"connectionString="Data Source=000.000.000;Initial Catalog=Database Name;Persist Security Info=True;User ID=XXXXXX;Password=XXXXXX;"providerName="System.Data.SqlClient" />

</connectionStrings>

The test page has a GridView in it which uses the connectionstring fron the web.config file.

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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

Not sure why .NET thinks it's a SQL 2005 server

I can connect to the database via VS 2005, and through Enterprise Manager... just from the ASP.NET page.

Any ideas?

Thanks,
Roland

By default SQ2005 does not have remote connections enable, you need to go to Surface Configuration and the first tap change from pipe to remote connections. That shall fix the problem.

|||

Thanks Al, but the problem is that the server is SQL 2000 and NOT SQL 2005.

So, I'm not sure why .NET thinks, or is getting the information to say that the SQL server is SQL 2005.

So to reiterate the question:

Why do I get a SQL 2005 error while connecting to a SQL 2000 database?

Thanks again,

Roland

|||

Then must be a firewall between or again you can change SQL 2000 to use only pipes, check that and let me know

|||

Why you got a message about MS SQL Server 2005 while the version you have is MS SQL Server 2000?

This is beacuse you are using MS Viusal Studio.NET 2005 which install a SQL Express (lite SQL Server - similar to MSDE) on your machine and by default it will coneect to it.

This SQL Express uses a SQL Server 2005 engine, and that is why you saw "When connecting to SQL Server 2005, ...." message.

Ok, what to do?

Change the default connection string from your IIS.

Open your IIS, then click on your "Virtual Directory" (e.g. your ASP.NET Website) then go to its configuration and change the Server name part in the ConnectionString.

Hope this will help you as it helped me eairler.

Regards,

sqlsql

Tuesday, March 20, 2012

Connecting to Northwind on SQL Server 2000

I've just installed SQL Server 2000 on my local machine. I'm using the following element in my web.config file for my connection string.

<add key="SqlNWind512" value="server=(local)\141.705.84.745;database=Northwind;
user id=sa;pwd=h3fe8eq7;packet size=512;" /
Unfortunately, I'm getting the following error on my aspx page:

SQL Server does not exist or access denied.

I had no problem writing a connection string to connect to the MSDE installed on my computer, but making a connection to the Northwind database on my newly installed SQL Server 2000 Developer edition has been elusive to me.

I'm sure my IP address is correct. The authentication mode for logging into the database via Enterprise Manager is setup to require a password for sa. Therefore, I assume it's required in the connection string?

Maybe not so coincidentally, while I have been able to open this database through the Server Explorer in VS.NET, I'm not able to access it via Enterprise Mananger (no response, it just hangs) or my aspx pages.

I'm dying here!!! Is my connection string wrong? Any insights would be greatly appreciated!just server=<ip address
forget the (local) bit if it's not local.|||Thank you!|||word to the wise..
Don't put your password to your database online on forums.

h3fe8eq7 can be a very bad thing.

Friday, February 17, 2012

connecting aspx to SQL Server 2000

Hello All,

I am just getting started on aspx, coming from an asp background.

I created the following connectionString in my web.config file:

<connectionStrings>

<addname="OuWebDB"

connectionString="server=OurServer;database=OurDatabase;uid=TheUser;pwd=ThePassword"

providerName="System.Data.SqlClient"

/>

</connectionStrings>

when I run this aspx file, from a machine, I get 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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

Help!!

thanks

Check outwww.connectionstrings.com for a proper connection string. Please search for these forums with your error message. I remember seeing previous posts with same question.

|||

Sorry,

I did some searching around, and I still have the following issue:

I can not telnet to port 1433 (even localhost on the SQL Server 2000 machine).

1. TCP/IP and Named Pipes are both 'enabled' within SQL Server Client Network Utility.

2. I read something about having to be at a certain SERVICE PACK to overcome this error, is that the case? If so, is it for SQL Server or Win2003?

Other Question: Should I just stick to ODBC connection strings, which have worked well in the past, for my asp applications?

thanks..

|||

I have found my problem, thanks... it is related to my service pack version