Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Connecting to SQL Server with Visual Studio Express Editions [closed]

I find it odd that in Visual C# 2008 Express edition, when you use the database explorer, your options are:

  1. Microsoft Access
  2. SQL Server Compact 3.5, and
  3. SQL Server Database File.

BUT if you use Visual Web Developer 2008 Express, you can connect to a regular SQL Server, Oracle, ODBC, etc.

For people developing command-line or other C# apps that need to talk to a SQL Server database, do you really need to build your LINQ/Data Access code with one IDE (Visual Web Developer) and your program in another (Visual C#)?

It's not a hard workaround, but it seems weird. If Microsoft wanted to force you to upgrade to Visual Studio to connect to SQL Server, why would they include that feature in one of their free IDEs but not the other? I feel like I might be missing something (like how to do it all in Visual C#).

like image 308
Tom Lianza Avatar asked Oct 09 '08 20:10

Tom Lianza


People also ask

Which SQL Server is compatible with Visual Studio 2019?

No. It only supports any edition before 2012 of SQL Server. The latest version is Visual Studio 2019. BTW, after upgrading Visual Studio you should use the latest SQL server (2019), which is always correct.


1 Answers

You should be able to choose the SQL Server Database file option to get the right kind of database (the system.data.SqlClient provider), and then manually correct the connection string to point to your db.

I think the reasoning behind those db choices probably goes something like this:

  • If you're using the Express Edition, and you're not using Visual Web Developer, you're probably building a desktop program.
  • If you're building a desktop program, and you're using the express edition, you're probably a hobbyist or uISV-er working at home rather than doing development for a corporation.
  • If you're not developing for a corporation, your app is probably destined for the end-user and your data store is probably going on their local machine.
  • You really shouldn't be deploying server-class databases to end-user desktops. An in-process db like Sql Server Compact or MS Access is much more appropriate.

However, this logic doesn't quite hold. Even if each of those 4 points is true 90% of the time, by the time you apply all four of them it only applies to ~65% of your audience, which means up to 35% of the express market might legitimately want to talk to a server-class db, and that's a significant group. And so, the simplified (greedy) version:

  • A real db server (and the hardware to run it) costs real money. If you have access to that, you ought to be able to afford at least the standard edition of visual studio.
like image 64
Joel Coehoorn Avatar answered Oct 08 '22 03:10

Joel Coehoorn