I am new to dotnet. I tried connecting to the database MS SQL Server 2000

Posted by Pokuri31 under ASP.NET on 1/5/2009 | Views : 1290 | Status : [Member] | Replies : 2
Hi All,

I am new to dotnet. I tried connecting to the database MS SQL Server 2000.

But I could not connect. The error message highlights the line myConnection.Open() and displays the 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)

It tries connecting to SQL Server 2005. There is no SQL Server 2005 in that system. There is only SQL Server 2000.

I have the aspx code in my local system and the database in another machine.

Could Someone please help me out in solving this problem.



Thanks,

Rama




Responses

Posted by: Poster on: 1/5/2009 [Member] Starter

Up
0
Down
I guess your code is written well, most probably the problem is from the database end. Generally this type of error occurs in the following conditions

1. Your username, password is wrong.
2. You don't have proper access to the database, ask from the database administrator or try creating a user with full access.
3. Try the setting of database connectivity, may be your database setting doesn't allow Sql Authentication, it allows only Windows authentication or vice-versa.
4. If not, there might be little problem in the connection string, try this website http://www.connectionstrings.com/ or http://www.sqlstrings.com/ for connection strings.

Hope this will help.

Thanks

Pokuri31, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Amansandha on: 1/19/2009 [Member] Starter

Up
0
Down
hi

i think this problem a\occuer when database is not ready

or your username pasword does not match

or if u know the IP addt\ress then try to give it and you should confirm that server machince is installed on sqll authntication or or windows and it allows the access of database
and sometimes firewell can occuer this erroe that doesnt allow so pl off firewell setting or off antivirus then try

thnx

with regards
Aman

Pokuri31, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response