Easily Setup Fluent Nhibernate With Oracle
page 1 of 3
Published: 01 Mar 2011
Unedited - Community Contributed
Abstract
Nowadays it is preferred to use ORM instead of old data access approaches. However, setting up an ORM like Fluent NHibernate with Oracle takes some time. With the help of NuGet you can setup such third party tools in no time. In this article I am going to to show how you can easily configure Fluent NHibernate with Oracle using NuGet. Moreover, the article will guide you in building a generic repository using Fluent NHibernate.
by Muhammad Bilal Ashraf
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 24390/ 110
Article Contents:

Introduction

Mostly setting up environment/third party tools for development takes a long time because there is painstaking configuration and reference setup involved which needs to be taken care of. But now with the help of NuGet you can set it up within no time. In this article I am going setup Fluent NHibernate with Oracle using NuGet because there is not so much documentation available on this. Later, I’ll show you how you can implement a repository pattern using Fluent NHibernate. I have tried to make it a baby step procedure and I hope after reading this article you will be able to setup Fluent NHibernate with Oracle in no time.

Tools

1. Visual Studio

2. NuGet for adding Fluent Nhibernate & NHibernate references  http://nuget.codeplex.com/

3. Oracle Data Access for .NET http://www.oracle.com/technetwork/database/windows/downloads/utilsoft-087491.html/


View Entire Article

User Comments

Title: ORM, fluent nhibernate, oracle   
Name: laura
Date: 2012-08-03 3:50:29 PM
Comment:
Excellent article, i wish i had found this ealier
Title: Solution   
Name: Bilal
Date: 2011-07-21 6:45:45 AM
Comment:
Well there are two Data Provier implementations for connecting to Oracle thru .Net Code.
1. Microsoft
2. Oracle
I have used Oracle Implementation and referenced Oracle Data Access for .NET http://www.oracle.com/technetwork/database/windows/downloads/utilsoft-087491.html/

The Error is coming because you are referencing Microsoft DLL 'System.Data...'. You should use Oracle Provider DLL instead 'Oracle.DataAccess.Client' .
Title: Mr   
Name: Sudhir
Date: 2011-07-21 4:58:21 AM
Comment:
Same error coming as Mr Jason Lee is saying. Please resolve and update the code
Title: System.InvalidCastException:   
Name: Jason Lee
Date: 2011-03-22 9:31:51 AM
Comment:
Would you happen to know what causes this error. Most of the searching turns up responses for NH instead of FNH. The code seems to error on BuildSessionFactory()

Unable to cast object of type 'Oracle.DataAccess.Client.OracleConnection' to type 'System.Data.Common.DbConnection'.


Line 31: throw;
Line 32: }
Line 33: return c.BuildSessionFactory();
Line 34: }
Line 35: }






Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2017 ASPAlliance.com  |  Page Processed at 2017-11-24 6:21:53 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search