PDA

View Full Version : Need some help


pk0321
04-22-2008, 06:00 AM
I have started a new website. This is my first time uploading a website to the internet, I have always just played around locally.

I have added a LOGIN control to my site and it works fine locally, but does not connect to the database on the site.

How do I get my site to point to the database. I added a SQL 2005 database to my site, but do not know how to configure.

Please help?

wisemx
04-22-2008, 10:31 AM
Please see if this helps:
http://iis7testcom.web701.discountasp.net/membershipprovider/

pk0321
04-23-2008, 05:21 AM
Thank you, I appreciate the links, but I am still having no luck. I think I have bitten off more than I can handle. I can not believe that it is this difficult. All the articles are not helping. I follow the instructions best I can but still no luck.


I have added a SQL 2005 database to my site. I am using Visual Web Developer 2005. My site is running on a Windows 2003 server running IIS6 I believe which I also configured on my local machine.


I need someone to walk me through step by step how to make my local copy of my site connect to the database I added to my website once I upload it to the server. Arghhh!

wisemx
04-23-2008, 05:25 AM
Have you watched these Videos?
http://asp.net/learn/

Most of them were made using VWD.

If you need a specific step-by-step you don't see there let me know and I'll create a video.
Salute,
Mark

pk0321
04-23-2008, 05:34 AM
Is there a particular video that you recommend. I have watched most of these and they are too broad.

pk0321
04-24-2008, 10:47 AM
I think I am making some progress. I have been able to connect to my SQL Database on DISCOUNTASP.NET. I have also ATTACHED my ASPNETDB.MDF to the database named SQL2005_468377_gmi1 and then verified the tables are in the database.

But I still get the following error when I try to login to my site:

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


My connection stringis as follows (password replaced with ******):


<connectionStrings>
<add name="LocalSqlServer
connectionString="Data Source=tcp:sql2k507.discountasp.net;Initial Catalog=SQL2005_468377_gmi1;
User ID=SQL2005_468377_gmi1_user;Password=******; Integrated Security=SSPI;User Instance=true"
providerName="System.Data.SqlClient"/>
</connectionStrings>


Are the login controls looking for a database names ASPNETDB.MDF or a datasource name? I know this will all make sense once it all comes together?


What should my next step be? Thanks in advance, Tony

wisemx
04-24-2008, 11:50 AM
At times using the Clear and Add Remove commands will resolve this.
Try your connection string like this and see if it helps:

[quote]

<connectionStrings>
<clear/>
<remove name="LocalSqlServer"/>
<add name="LocalSqlServer" connectionString="Data Source=tcp:sql2k507.discountasp.net;Initial Catalog=SQL2005_468377_gmi1;User ID=SQL2005_468377_gmi1_user;Password=******;" providerName="System.Data.SqlClient"/>
</connectionStrings></CODE>This is a trick Scott Guthrie often recommends and I have found it to be very helpful.
http://weblogs.asp.net/scottgu/default.aspx
http://weblogs.asp.net/scottgu/archive/2006/11/20/common-gotcha-don-t-forget-to-clear-when-adding-providers.aspx

Salute,
Mark
PS - Sorry for not getting back quicker, I'm doing a ton of plumbing work in our house the past few days.

pk0321
04-25-2008, 03:54 AM
Thanks for the help. I finally go it working. I ended up having toremoveproviderName="System.Data.SqlClient fromt he connection string. I guess this point to a mySQL database and I was using a SQL 2005 database.


Another question for ya though. Now that my ASPNETDB.MDF file is attached to my SQL database on DISCOUNTASP.NET, what is the purpose of the ASPNETDB.MDF file in my application? Do I stil need it?

wisemx
04-25-2008, 03:59 AM
No you don't need it anymore, just back it up on your local system somewhere in case you need it again.