<p>I'm working on a side project that would be a simple web application to maintain a list of classes and their upcoming schedules.</p>

<p>I would really like to use Linq to SQL for this project, but unfortunately the server environment I'm developing for only has MySql available. I've dabbled briefly with Subsonic but it just doesn't get the job done.</p>

<p>The database requirements for this application aren't that great, though, so I'm curious if using an MDF file in App_Data would be a workable solution. Otherwise, it appears I'm going to have to hand-code sql queries which I want to avoid at all costs.</p>

[{'answer_id': 35246, 'author': 'dguaraglia', 'author_id': 2384, 'author_profile': 'https://Stackoverflow.com/users/2384', 'pm_score': 0, 'selected': False, 'text': '<p>I don\'t understand... what do you mean by "having an MDF file in App_Data"? You need a proper SQL Server installation for that to work. You can always use the free SQL Server Express for developing the application, and then move the database to the proper SQL Server once you are done. Check <a href="http://www.microsoft.com/sql/editions/express/default.mspx" rel="nofollow noreferrer">here</a>.</p>\n'}, {'answer_id': 35268, 'author': 'Forgotten Semicolon', 'author_id': 1960, 'author_profile': 'https://Stackoverflow.com/users/1960', 'pm_score': 1, 'selected': False, 'text': "<p>More likely you'd put an Access database in App_Data.  If you're using a MSSQL MDF file, you'll definitely still need either MSSQL or MSSQL-Express.</p>\n\n<p>Your question is confusing, however.  You seem to interchanging data access, ORM and the actual database.  You can use SubSonic with MySQL, but you cannot use LINQ to SQL with non-MS databases or MS Access.</p>\n"}, {'answer_id': 35276, 'author': 'Adam Lassek', 'author_id': 1249, 'author_profile': 'https://Stackoverflow.com/users/1249', 'pm_score': 0, 'selected': False, 'text': "<p>It appears that I was misunderstanding how mdf files are accessed through .net. There is no MS SQL Server available on the server, so it looks like I'm screwed.</p>\n"}, {'answer_id': 35277, 'author': 'Jeremy McGee', 'author_id': 3546, 'author_profile': 'https://Stackoverflow.com/users/3546', 'pm_score': 1, 'selected': False, 'text': '<p>One of the few differences between SQL Server Express and the "full" SQL Server is the ability to automatically attach to MDF files - what Microsoft call "<a href="http://msdn.microsoft.com/en-us/library/ms165716.aspx" rel="nofollow noreferrer">xcopy deployment</a>". </p>\n\n<p>SQL Server Express is free (as in beer) so unless you have no administrator rights on the box for installation, this should work fine.</p>\n'}, {'answer_id': 35307, 'author': 'jmatthias', 'author_id': 2768, 'author_profile': 'https://Stackoverflow.com/users/2768', 'pm_score': 4, 'selected': False, 'text': "<p>Take a look at Microsoft SQL Server Compact Edition. I believe you can work with MDF files without having to run a server. All code runs in process. I believe it has some limitations but it may work for you and I think it's free.</p>\n"}, {'answer_id': 35512, 'author': 'Joel Coehoorn', 'author_id': 3043, 'author_profile': 'https://Stackoverflow.com/users/3043', 'pm_score': 1, 'selected': False, 'text': "<p>+1 for SQL Server Compact.  It's free and there's no 'engine' in the sense of a full-time service, but you do have to deploy a runtime (it's just two .dll files).</p>\n"}, {'answer_id': 35514, 'author': 'flipdoubt', 'author_id': 470, 'author_profile': 'https://Stackoverflow.com/users/470', 'pm_score': 2, 'selected': False, 'text': '<p>To the best of my knowledge, you can attach directly to the MDF (called a "user instance", rather than attaching the MDF to a "server instance") only if SQL Server Express is installed on that machine. So your machine that has MySql on it would also have to run SQL Server Express.</p>\n'}, {'answer_id': 38742, 'author': 'Orion Edwards', 'author_id': 234, 'author_profile': 'https://Stackoverflow.com/users/234', 'pm_score': 0, 'selected': False, 'text': "<blockquote>\n  <p>+1 for SQL Server Compact. It's free and there's no 'engine' in the sense of a full-time service, but you do have to deploy a runtime (it's just two .dll files).</p>\n</blockquote>\n\n<p>Does linq to sql work with that though?</p>\n"}, {'answer_id': 1021513, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 0, 'selected': False, 'text': "<p>you can't use SQL Server Compact with asp.net or web development</p>\n"}, {'answer_id': 1157405, 'author': 'Adam Lassek', 'author_id': 1249, 'author_profile': 'https://Stackoverflow.com/users/1249', 'pm_score': 3, 'selected': True, 'text': '<p>I\'ve long since completed the project which prompted this question, but recently I\'ve had another project come along with very minor data requirements, so I spent some more time experimenting with this.</p>\n\n<p>I had assumed that Sql Server Express required licensing fees to deploy, but this is not in fact the case. According to Microsoft\'s website, you are free to use it with certain restrictions:</p>\n\n<ul>\n<li>Maximum database size: 4 GB</li>\n<li>Maximum memory used: 1 GB</li>\n<li>Maximum CPUs used: 1 (complete procs, not cores)</li>\n</ul>\n\n<p>Sql Server Compact is a bad idea for web applications because it requires a hack to make it work, and it isn\'t built for the concurrent access you\'d need for the web. But if your application can fit within the modest limitations of Sql Server Express, it works pretty well. And since it speaks regular T-SQL like its larger siblings, you can use Linq to SQL with it.</p>\n\n<p>I hear that <a href="http://twitter.com/migueldeicaza/status/2368465000" rel="nofollow noreferrer">Linq to Sql support is now in the Mono trunk</a> for the 2.6 release, so L2S\' tight-coupling to Sql Server will likely be a moot point in the near future. I will either end up porting my code to use Mono\'s superior Linq to Sql implementation on the db of my choice, or go <a href="http://subsonicproject.com/" rel="nofollow noreferrer">another route entirely</a> (SubSonic has improved by leaps and bounds since I last tried it). But for the time being, Sql Server Express is a valid choice for very small database-driven apps.</p>\n'}]
['https://Stackoverflow.com/questions/35232', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1249/']