All,
I may have bitten off a bit much here, but here goes. I'm trying to learn ASP.NET while at the same time learning SQL 2005. I have two machines. One is running Visual Studio 2005 and SQL 2005 Express. The other is my "production" box which is running VWD 2005 and SQL 2005 Standard. I picked up some WROX books and began learning. So far so good until about half way through the book on ASP (keep in mind I haven't learned SQL yet). I learned that I can use the ASP.NET configuration menu to automagically create a database, populate it with users, add them to profiles (groups), and grant them rights to pages. This was kind of neat and it worked fine on my dev box. So I looked up in my SQL book how to detach a DB, copy it over to the other machine and re-attach it. So I copied the whole web site (DB and all, under APP DATA) to the other machine and reattached it. This seemed to go well, however when I tried to log in I recieved an error.
***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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
After doing some hunting around I discovered that I'm supposed to have a connection string. I checked my web.config file and the only thing I find there is
<
appSettings/><
connectionStrings/><
system.web>As you can see this doesn't point to a database which the docs I found say is how you connect to them. Apparently one error someone can run into is between expree and SQL where you have to change the connection string. Well, it's not in the web.config. So I checked the default and login page (and code behind files), but found nothing. So, I'm at a loss. I have no idea where the problem is or where to go from here. Any assistance will be appreciated. While I'm enjoying the journey of learning this, the road seems to be kind of bumpy.
Thanks in advance - Stephen
Hi Stephen,
to change default connection string in web.config you can remove and add new one it's name LocalSqlServer like..
<connectionStrings>
<removename="LocalSqlServer"/>
<addname="LocalSqlServer"connectionString="your connection string..."/>
</connectionStrings>
and give look at this article aboutMembership you will find also how to config Membership
I hope this help
No comments:
Post a Comment