Tuesday, February 14, 2012

Cannot connect to locally SQL Server in C#.net 2005 Express

I am trying to do the Chapter 1 project of Getting Started with ADO.net 2.0 Step by Step (microsoft press)...

I enter the data source configuration wizard and select database, and press next.

I then press the new connection button, and the Choose data source screen appears.

In the List are only 2 options:

Microsoft Access Database File

Microsoft SQL Server Database File.

The option they want me to choose does not appear in the list.

Microsoft SQL Server sqlclient

I tried following the instructions in this thread [http://forums.microsoft.com/msdn/showpost.aspx?postid=85686&siteid=1] where a user had a similar problem, but had no success.

I have reinstalled C#, reinstalled SQL Server Express 2005 with Advanced Tools, but neither helped.

Any help would be greatly appriciated.

sao123

This seems like a difference between Express and Pro edtions of these products. The connections between VS and SQL are slightly different in the Express Edtions of VS. I've read parts of this book and you have to modify the connection instruction when you're using an Express Edition, the book assumes you're using VS Pro.

I found you could either must make a copy of the database into each project and change the connections to be User Instance based, our you could manually Attach the database to the SQL Express Parent and then modify the connection strings manually an not follow the instructions in the book.

Mike

No comments:

Post a Comment