Go to DotNetFunda.com
 Online : 1381 |  Welcome, Guest!   Login
 
Home > Forums > ASP.NET > I am new to dotnet. I tried connecting to the database MS SQL Server 2000 ...

  • Download the OOPS, ASP.NET and ADO.NET Training Videos for FREE, click here.

ASP.NET Forum



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

Author: Pokuri31 | Posted on: 1/5/2009 | Category: ASP.NET | Views: 251 | Level: Starter | Status: [Member] |

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


Reply

Interesting?   Share and Bookmark this

 Responses

Poster  
Posted on: 1/5/2009 7:26:45 AM
Level: Starter | Status: [Member] | Reply

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, please login to Mark As Answer, if this helps | Alert Moderator 

Amansandha  
Posted on: 1/19/2009 1:42:33 AM
Level: Starter | Status: [Member] | Reply

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, please login to Mark As Answer, if this helps | Alert Moderator 

Latest Posts

More ... 

 Write New Post


Advertisement

About Us | The Team | Advertise | Contact Us | Feedback | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you found copied contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
All rights reserved to DotNetFunda.Com. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks.
(Best viewed in IE 6.0+ or Firefox 2.0+ at 1024 * 768 or higher)