1

Does anybody know of any good tutorials that show how to configure FluentNhibernate for SQL Server 2005/2008. The ones I have found usually just use SQLite, but I would like to see one that specifically targets SQL Server 2005/2008.

I really liked the sample tutorial on the FluentNhibernate website (http://wiki.fluentnhibernate.org/Getting_started#Your_first_project), but it looks like most tutorials I have found seem to only deal with SQLite. It would be great to see a working tutorial that deals with the more common databases in real world applications like SQL Server 2005/2008, MySQL, etc Thanks!

1 Answer 1

5

Tutorials use SQLite not because it's "quick & dirty" but because it's embedded, small, and free. Anyone can download System.Data.SQLite and start working in about 60 seconds, and later switch (or not) to another database with minimum impact. That's one of the major benefits of using an ORM.

Just in case, I want to clarify that SQLite is not a toy database, for many applications it's enough and even necessary since the characteristics I mentioned above aren't too common for a relational databse.

In the case of fluent-nhibernate, the only difference is that instead of:

Fluently.Configure()
.Database(
  SQLiteConfiguration.Standard
    .UsingFile("firstProject.db"))...

you'll have:

Fluently.Configure()
.Database(
  MsSqlConfiguration.MsSql2005
     .ConnectionString("a raw string"))...

Each database engine config has its own specific optional settings. More information about configuring different databases in the fluent-nhibernate wiki.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks! If this is the only difference, then I'm good to go. It is my first time working with FluentNhibernate and personally, I learn better by working through example projects, which the FluentNHibernate Wiki does an awesome job of doing.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.