views:

16504

answers:

6

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#).

Thanks! Tom

+1  A: 

My guess is that with VWD your solutions are more likely to be deployed to third party servers, many of which do not allow for a dynamically attached SQL Server database file. Thus the allowing of the other connection type.

This difference in IDE behavior is one of the key reasons for upgrading to a full version.

Mitchel Sellers
+1  A: 

Surely you can still connect in code, regardless of what the IDE does or doesn't do?

Dan Revell
Yup, for sure. In this case, the issue has less to do with connecting and more to do with using the modeling tools to build the ORM layer, which unless you want to hand-code a bunch of XML, is an IDE's job.
tlianza
+7  A: 

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.

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 want to talk to a server-class db, and that's a significant group. And so, the simplified (greedy) version:

  • If you can get access to a real db server (and the hardware to run it), you ought to be able to afford at least the standard edition of visual studio.
Joel Coehoorn
Unfortunately now that we're in VS2010, there is no "standard" edition... the lowest level is Pro, which is over $1k. A pain when I'm just trying to prototype something against a server database.
Scott Whitlock
A: 

If you are using this to get a LINQ to SQL which I do and wanted for my Visual Developer, 1) get the free Visual WEB Developer, use that to connect to SQL Server instance, create your LINQ interface, then copy the generated files into your Vis-Dev project (I don't use VD because it sounds funny). Include only the *.dbml files. The Vis-Dev environment will take a second or two to recognize the supporting files. It is a little extra step but for sure better than doing it by hand or giving up on it altogether or EVEN WORSE, paying for it. Mooo ha ha haha.

Jason
A: 

The only way I was able to get C# Express 2008 to work was to move the database file. So, I opened up SQL Server Management Studio and after dropping the database, I copied the file to my project folder. Then I reattached the database to management studio. Now, when I try to attach to the local copy it works. Apparently, you can not use the same database file more than once.

Z.K.
A: 

This weird solution just forces me to download VS Bazaar Edition. If you want ppl to buy better car, you can remove from the cheaper version cd-player but not the gearbox.

Joe, with respect,

  • If you're using the Express Edition, and you're not using
    Visual Web Developer, you're probably building a desktop program.
    (YES, phone book)
  • 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.
    (YES, my CD library bedroom-programmer)
  • 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.
    (And this "probably" is actually FORCING ME to don't move behind this weird limit. Ergo: Visual C# Express is mostly useless for normal hobbyist w/o even LOCAL database access. Simple phone book is just IMPOSSIBLE to develop. Compact Edition is evil as well as his inglorious predecessor Desktop Engine, at least for hobbyist. Why not write MS Access macros then? Or better - switch to Atari Basic? Clipper 5 was great! Come on, we are living in the world of data, just greedy MS finds out ppl working via RDP using Express editions, so locked EVEN localhost instances, that's all the philosophy here, let's don't build clever explanation for this obvious fact. Previous versions was working just fine that's why ppl got upgraded (and now downgraded having VS2005 from torrents without any possibility to move forward.

Great, the day of releasing web framework for c++ will be probably the last day of C# express editions. Especially if the next limitation in i.e. Visual C# 2012 will be 3 windows Forms and no more than 2 projects in a solution (it's a strong logic behind: if you are using express and not developing for companies blah blah blah)

That's Apple way, my friend. Straight to nowhere. Why to keep RDP development server with legitimate Windows (which I'm paying every month for last 5 years including some pennies for Windows license)?

I can't find any reason, for hobbyist like me. Just Connector.NET and switch straight to MySQL/PostgreSQL, if I cant use Linq/DataEntities and I'm a hobbyist with 100 rows of data. Does MSSQL really matters to me?

Advantage of this goofy limitation: ppl will learn how to use alternatives. Apart from spiting into developers eye, that's basically appholes business model: more colors, smoother font and as many limitations as is possible. Yep, but ppl who likes to be treated this way, already have macbooks and iphones, they are not developing winforms for .NET)

  • You really shouldn't be deploying server-class databases to end-user desktops ( I appreciate the advice, but I would love to decide myself)
pr0siak