Posts
12
Comments
10
Trackbacks
0
[EF + Oracle] Intro

Prologue

I have a busy personal and working time, and at this moment that I start to get more free time, I decided to start a Serie about Entity Framework with Oracle.

A few time ago, I got my first experience with EF and Oracle with Oracle 10 g express and Oracle 10 g with the same results, Doesn’t work.

Now I download Oracle 11 g to Test again.

Tools

To start using EF with Oracle we need the following:

1. Visual Studio 2010. No Express Edition

2. Oracle 11g

3 Oracle Driver for EF (ODAC)

Intro

People, who are starting with EF developments, I recommend to take a look into Unai Zorrilla’s Blog, the post were written in Spanish but they are great!

To this Serie, we are going to define the DB from the Oracle administrator. For that we need to follow the next steps:

1. Create a User with a PassWord. In my example the user will be Jtorrecilla

2. Create a TableSpace

3. Define some example tables

 

(Image1)

When we have created the DB, we are going to start a new project in VS 2010. I will start a C# Project.

To start with EF, we need to add a new objet to our Project “ADO .NET Entity Data Model".

(Image2)

The next step will be to indicate that our model will be based on an existing DB, and indicate the connection string (Images 3 and 4):

(Imagen3)

(Imagen4)

Once we selected the connection string, we will need to indicate that in the connection will be saved “Sensitive” data (Image 5), and in the next step we are going to select the DB objets to use in the project(Image 6).

 

(Image 5)

(Image 6)

At the end, we will press Finish button, and it will generate a EDMX file to add to our solution, and in the IDE will appear the DB Schema with the selected Tables and Relations.

(Imagen7)

One Entity is composed by a set of properties (each matches with a column from the Table in the DB) and Navigation Properties that represents any relation with other Entities.

 

Finally

With this chapter we have installed the environment, defined a DB and configured the solution to start using EF with Oracle.

In the next chapter we are going to see What is a Entity and how it works.

I hope you enjoy this Serie!

posted on Tuesday, March 1, 2011 4:27 PM Print
Comments
Gravatar
# re: [EF + Oracle] Intro
Ricardo Peres
3/1/2011 4:43 PM
Nice! And how do we configure primary key generation (sequences)?
Gravatar
# re: [EF + Oracle] Intro
JTorrecilla
3/1/2011 5:25 PM
Hi Ricardo, Firstly thanks for the comment.
Well now i have no think yet to it but there is a way to create the key, but usually I dont like too much Sequence, In the next post, I will Give different options!
Gravatar
# re: [EF + Oracle] Intro
Bill Campbell
3/2/2011 1:21 PM
Great! I was hoping someone would start a blog on this. Just out of curiosity, do you know if this will work when pointing to a Oracle 10 database or is 11g required. I know many times you can use previous versions.
Looking forward to your next post!
regards!
Gravatar
# re: [EF + Oracle] Intro
JTorrecilla
3/2/2011 1:25 PM
Hello Bill,

Currently I have tested to Oracle 10g and 10 g express with no success.
I believe that Oracle is working on a patch to Oracle 10g, but not sure...

Could you try to ask in the Oracle Support Forum :S

Thanks!
Gravatar
# re: [EF + Oracle] Intro
Lewis
3/8/2011 9:11 AM
A the end of the selection, we will press Finish button, and it will generate a EDMX file to add to our solution
Gravatar
# re: [EF + Oracle] Intro
Shilpa
11/20/2012 1:10 PM
Not able to see images

Post Comment

Title *
Name *
Email
Comment *  
Verification