Any Rails-Migration-like framework suggestions for .NET? - database

The idea of "rails migration" is awesome and I'm going to use this way in my coming new project on .NET platform for db schema version control.
MigratorDotNet seems like something I need but some limitations block me, such as no stored procedure support. Are there any better solutions for that?

There's a similar question, which incidentally shows up as one of the top google results (wooo, gogo stackoverflow!) with a nice roundup in the top scoring post:
https://stackoverflow.com/questions/313/net-migrations-engine

Related

Data Access in ASP.NET MVC 3

What's the recommended way of creating a Data Access layer in real-life ASP.NET MVC applications? Is it EF? Ef Code First? NHibernate? Any other idea?
Thank you & regards
There is no recommend way.
I prefer EF Code First for doing this because
the Sourcecode is very clean and easy to read
It is easy to simple change the connectionstring and generate a new database if not already exists
easy to migrate your Database if your Model has changed (no need to recreate the Database) using EntityFramework.SqlMigrations
if your Database already exists you can use the Entity Framework Power Tools to generate the Models and Database context from your existing Database
It all depends of your need:
NHibernate is a more mature ORM with a big community
Entity Framework is now getting very well supported and you can find also great information (check Julie Lerman blog)
Both support code generation from database.
Code first: allows you to create your database schema from your domain models. This is great if you don't want to bother with database. NHibernate can do it also.
To help you decide which way to use Entity Framework
Source
There are many other great ORM:
Subsonic
Stackoverflow's ORM Dapper if performance is an important criteria there is a small benchmark on the site
If you're partial to the MSFT tooling and wanting to be "modern", then EF Code First is probably the place to start. One example worth perusing: https://github.com/NuGet/NuGetGallery .
I like to use Model First because it allows me the most freedom to design and implement in my opinion. It also makes it very easy to change the database design.
There is none, stackoverflow is full of people who have gone down the various routes, so you can get help no matter which choice you make.
Best advice, try doing a few small exploratory webs using a couple of approaches which seem to stand out.
The MVC gurus (the people who wrote MVC) at MS all seem to use Entity Framework at the moment. having said that you can use any ORM (or really any data access tech you want) as MVC doesnt actually specify anything at all about the way you access data
Try LINQ, most MVC products I see make use of LINQ.

How to make a scaling project using CakePHP?

I wanto to know if there is some tutorials, books etc.
that explai how to make a scaling project using CakePHP
Here is a good article on how to speed up cakephp performance. Also take a look at the comments after the article.
http://www.pseudocoder.com/archives/2009/03/17/8-ways-to-speed-up-cakephp-apps/
I would look first at optimisation over scalability. CakePHP is very able to handle large applications and databases. But in answer to your question...
Try Googling "Cakephp scalability"
http://philip.greenspun.com/seia/scaling
http://www.rawseo.com/news/2009/06/25/better-ways-to-improve-php-application-performance/

How can I develop a database for users to access via a browser

Years ago (pre-web) I used to be a Fortran developer (yes it was a very long time ago!) but these days I run a small non-IT business. I would like to develop a database application for my clients to access via a browser (or maybe down the line via a mobile phone). I haven't done any programming for a while apart from some VB macros in Microsoft Excel. I would be grateful if anyone could suggest the best language/technology to learn to get me heading in the right direction.
As Neil said in his comments there are dozens of different, valid answers to this.
Usually I would suggest going with a language you already know, but neither Fortran or VBA are really suited for this task, as far as I know.
Personally I would suggest Django, which is a web framework written in Python. It simplifies many common tasks and it is very well documented.
But there are many more possible solutions.
Before I started with a framework I'd break the problem into pieces. If you've never done anything with a database before you'll find that challenging enough without piling web or mobile on top of it.
Model your problem and get a good object or data model in place. Test that thoroughly without thinking about UI. Once you have that, perhaps you can expose it as services that any UI can call.
You'll quickly become overwhelmed if you try to do it all at once.
Here's another thought: If these are paying customers, why not do yourself and them a favor and hire someone that knows how to do this? It's great that you used to write Fortran, but if you haven't kept up you won't be doing your business any good by putting out a bad first effort for customers to see.
Do it right - get a professional. Do your learning on your own time.
You can use ASP.NET and SQL Server to get something online that will allow users to edit a database table fairly easily. They've simplified it to the point where you can drag and drop the necessary controls (GridView and a SqlDataSource for instance) and define your datasource in a wizard for most simple table CRUD functionality. Basically give users the ability to edit a table without writing any code.
If you need to do something a little more difficult it's easy to write code that will add functionality to the original drag/drop stuff you did.
There are lots of good resources out there for asp.net and C# also, so it will help you get up to speed quickly.
Keep in mind that I work almost entirely with .NET/SQL Server so my opinion will be slanted towards them...

Creating web forms from a database schema

I'm wondering if there are any applications, preferably freeware, that can take a database configuration, and, with as little hassle as possible, create web forms for inserting data easily.
I'm finding it hard to express exactly what it is I'm after. Maybe I can talk a bit about what I need.
I have a configuration database that, at least usually, contains "the truth" about the servers in our system. It contains stuff like zone names, hostnames, different configuration items, etc, over multiple tables. Right now we're using simple INSERTs directly when adding new servers or other stuff, handling the keys and IDs ourselves. The crux is, they don't want us to develop a simple web form thingy to handle this, instead they want a tool that can generate the web form thingy. Did that make sense?
I'm not sure if anything like this exists or is reliable, but, I thought that if anyone knew, it's this community. Thanks!
As many have already stated, it depends on what technology you're working with:
.Net 3.5 - Dynamic Data or Subsonic's Scaffolding control
.Net 2.0 - Subsonic's Scaffolding control
PHP - CakePHP
Ruby - Rail's Scaffolding component
"with as little hassle as possible"
have you checked things like PHP/MySQL Web Database Application Code Generator 10.02 ?
or phpmyedit ?
seems to me that what everybody else proposed so far requires a fair amount of coding...
Also, have a look at phprunner. It is not free, but looking at the screenshots, it seems to fit your requirements.
ASP.NET has Dynamic Data, that I think fits your description.
There's also SubSonic. Both are free and open source.
Tried Dynamic Data?
Besides ASP.NET dynamic data, you could also have a look at SubSonic
With PHP, if you have the ability to name the tables and columns as you see fit, you could try CakePHP framework, and specifically the scaffolding feature. With scaffolding turned on, the code will create CRUD forms from the schema for you.
Here's the link for learning about SubSonic & Scaffolding http://www.subsonicproject.com/web-forms-controls/the-scaffold/
, enjoy ;)
One more link from the SubSonic forums http://monk.thelonio.us/post/Scaffold-Enhancements-in-SubSonic-21.aspx
You can try Adminer Editor
Adminer Editor is both easy-to-use and user-friendly database editing tool written in PHP. It is suitable for common users, as it provides high-level data manipulation.

Querying like Linq when you don't have Linq

I have a project that I'm currently working on but it currently only supports the .net framework 2.0. I love linq, but because of the framework version I can't use it. What I want isn't so much the ORM side of things, but the "queryability" (is that even a word?) of Linq.
So far the closest is llblgen but if there was something even lighter weight that could just do the querying for me that would be even better.
I've also looked at NHibernate which looks like it could go close to doing what I want, but it has a pretty steep learning curve and the mapping files don't get me overly excited.
If anyone is aware of something that will give me a similar query interface to Linq (or even better, how to get Linq to work on the .net 2.0 framework) I'd really like to hear about it.
Have a look at this:
http://www.albahari.com/nutshell/linqbridge.html
Linq is several different things, and I'm not 100% sure which bits you want, but the above might be useful in some way. If you don't already have a book on Linq (I guess you don't), then I found "Linq In Action" to be be good.
You might want to check out Subsonic. It is an ORM that uses an ActiveRecord pattern. I'm pretty sure most of its features work with the .NET Framework 2.0.
To echo what Lance said - the SubSonic query language has a fluent interface which isn't as pretty as LINQ, but gives you some of the benefits (compile time checking, intellisense, etc.).
LinqBridge works fine under .NET 2.0, and you get all the Linq extensions and query language. You need VS 2008 in order to use it, but you already knew that.
However, Linq it not an ORM. It's a query syntax. If you want to use Linq to query a database, you will need .NET 3.5. That's because 2.0 does not provide the mechanism needed to convert Linq code to your favorite database query language.
In other words, if an ORM is what you need, LinqBridge will not help you. You need to check out some of the other suggestions provided.
There's a way to reference LINQ in the .NET 2.0 Framework, but I have to warn you that it might be against the terms of use/EULA of the framework:
LINQ on the .NET 2.0 Runtime
First of all. Getting linq itself to work on 2.0 is out of the question. Its possible, but really not something to do outside a testing environment.
The closest you can get in terms of the ORM/Dynamic Querying part of it, is imho SubSonic, which I'll recommend for anyone stuck in C# 2.0
LinqBridge looks like a pretty nice place to start since I have VS2008, I just need to compile and deploy to a .net 2.0 server.
I've looked at SubSonic and it's also an interesting alternative, but linqbridge seems to provide a much closer fit so I'm not going to have to go and learn a new ORM / query syntax.

Resources