Tuesday, March 20, 2012

problem of uploading asp.net website on web server

i have developed a website using asp.net, c# withSQL SERVER EXPRESS EDITION 2005. The database is being used both for retreival and updation purpose. the website is working accordingly when i m running it on my system, ie., data is getting retreived from the database and it is also getting updated on button click. But when i m uloading my site on the httpdocs folder of web server, connectivity with database is failing miserably, ie neither getting retreived from the database nor getting updated. The error message displayed by the web server is given underneath. i have used Grid view for displaying data from the database and Details view for updating the database.

i have used window authentication for connecting with the database.

Please help me with finding out a solution for it. give me proper explanation and i need to do

Server Error in '/' Application.

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)

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

smartymca:

this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections

Have you checked to see if this is the case or not? Simply pasting this error into google should show you how to do this.

|||

Hello smartymca,

I have recently uploaded my first ASP.NET website to the web, and I had exactly the same problem and error message. I found there were two reasons for this:

1. My hosting company require that my SQL Server database be located on a different server to the rest of my files! So check with your provider to see if your database needs to be in a specific place. I had to remove my database from my App_Data folder and recreate it on the correct server. I also had to change the connection string in my application to match the database's new location.

2. Now that my database was on a different server, the login system didn't work! This was because the default connection string for the Membership provider was no longer valid. There is however a very good video on this website that guides you through setting this up. It's the"ASP.NET How Do I? #13" video.

I hope this helps. If you think your problem is caused by the same thing then write back and maybe I can help.

|||

You will probably want to you SQL authentication because chances are, the SQL Server and the application server are on two different servers.

Who is your host?

|||

my web services provider is PROWEBS (prowebs.co.in).

|||

thanks for your reply. Yes i think my problem is same as your's, so please guide me.

My provider is (prowebs.co.in).

Tell me the steps you followed.

|||

smarty,

I've had a look at your provider's website and it appears to be exactly the same setup as my provider. You have to place your SQL Server database on a specific server for it to work - in your case, it is the "3Essentials MSSQL" server.

Unfortunately you cannot simply copy your existing database to the server (I had the same problem). A new empty database must be created on the 3Essentials server. Then, there are two things you can do.

If your database is still quite small and simple, you could recreate the tables yourself by connecting to your new database through MS Visual Studio. This is what I did.

If your database already has a lot of data in it and would take too long to recreate, you can transfer the data from your old database to your new database. This requires making a backup of your database using MS SQL Enterprise Manager (supposedly free to download from Microsoft, although when I tried, the download wasn't there) and then sending this backup to your provider so they can upload it for you. Detailed instructions can be found in your provider's FAQ.

smarty - are you using MS Visual Studio? If so, and you would like to try the first option, let me know and perhaps I could walk you through it. Send me a private message.

Patrick

|||

Patrick,

thnx for ur prompt reply..........

yes i m using MS Visual Studio and m also interested in using the first option............So, plz guide me through...........

|||

Ok,

1. Login to your user account at Prowebs. Find the database management section, and create a new MS SQL 2005 database. You'll give it a name, and a username and password.

2. Find out the server address for your new database. I guess it will be something like sql.3essentials.com. Also try and find out the connection string - my hosting company has a neat tool that tells you what it is. If yours doesn't, don't worry - you can find out in Visual Studio later.

3. Open up Visual Studio 2005. Click on the View menu and choose Server Explorer. Click on 'Connect to Database'.

4. In the new window, select the following options:

Datasource: Microsoft SQL Server

|||

i didn't get the server name. i put my dbi.3Essentials.com as server name but it still showing the same error which i have already given u.

|||

smarty,

Did you go through all the steps that I gave you? If not, how far did you get?

No comments:

Post a Comment