Connecting to SQL 2005

Two days on this issue, probably easy one but hard stuff for an average developer like me!

Sadly a proof that you can’t really depend on .Net 2.0 books yet. I believe the lack of experience from many means we have to survive only with Scott Guthrie and his team.

Anyway what happens here make sense when you finally see the light but at the start it baffled me for too much precious little hours.

First I installed SQL 2005, then VS 2005 without SQL Express 2005. Then I run in a lot of problems trying to setup the Membership provider correctly and make it working with SQL 2005. I am lucky enough to have on my bookshelf 99% of the ASP.Net 2.0 litterature but found nothing on the subject.

All the time when I was trying to setup some users with the Web admin Tool, always the same message ‘Unable to access the datastore’.

The solution is not that easy. I try to create a datasource and bind it to a web control, everything is OK. So it’s not a bad connection string.

Finally I decided to go through all the recent Scott’s posts and I discover this gem ! The trick is that ASP.Net 2.0 is setup by default to talk to SQL Express (why oh why the setup can’t modify automatically this behavior I don’t know??). So Scott give the easy solution which is to create a connection string in your config file using LocalSqlServer as the name and then to link the data source to your local SQL 2005 Db.

I wish to have this fix in a service pack. One thing I don’t understand. To use the ASP.Net configuration MMC snap in you need to have IIS installed. I know you can use VS 2005 without IIS, so how in this case do you reach the snap in?

 

2 Comments

  • I went through the same problem about one month ago. It took me whole evening and half of the night to figure it out. Can't wait for Service Pack... ;)

  • Thanks for posting this. I also went through this a few weeks ago after getting SQL 2005 Std and VS 2005 Std. My install sequence was the same, SQL then VS. I was trying to get the Club "Starter" kit running. It took me 2 days to get the connection working right.

Comments have been disabled for this content.