Install Oracle DB Express and Connect to ASP.Net MVC C# Using Dapper and ODP.net

Install Oracle DB Express and Connect to ASP.Net MVC C# Using Dapper and ODP.net


Download Complete Solution : https://github.com/haneefputtur/Haneef_Dapper_ODP_Net/archive/master.zip

View Source Codes at : https://github.com/haneefputtur/Haneef_Dapper_ODP_Net
Closed Caption:

[Music]
[Music]
uh hello my name is uh hanif today I'll
show you how to install Oracle database
Express Edition
and then I'll show you how to create a
user means it will automatically create
a schema then also how to Grant
permission for the created user for
various activities like create database
create procedures packages and all these
then I'll show how to log into the this
database using the toad okay and also
I'll show how to create a table then
I'll show how to create a package and a
procedure okay so I I think I'll in the
second part of this tutorial I'll
explain how to connect this procedure
into visual studio
2013 using Dapper and Oracle data
managed access okay okay let's start
with the installation part okay to
install Oracle desktop just go to this
link okay then you just go here then you
select this accept condition and then
you can select whichever if you're using
Windows 64bit then you can select this
link or if it is 32bit you can select
this one or if you're using any Linux
version you can go with this one okay so
once you download this one then I'll
show just explain okay you'll download
this one accept this one you download to
the desktop for example then you just
click open and you extract it to
somewhere then after it's a zip file
actually so once you extract you will
just run the setup and you just in the
first screen you just click next the
next screen you need to uh select I
accept the agreement Okay click next now
select the installation location you can
leave the default
location and the very important part is
when it asks for a system database
password just this is the system
password where this will be the like a
root account or admin account where you
will be using this account you'll be
able to manage the entire database
actually this is the master master
password so you create a password and
click next and and click finish okay so
this is like how to create in download
Oracle and also to install it actually
so once you install it then you just go
to the start menu then you go to all
programs you will see Oracle somewhere
here okay this one Oracle database first
edition okay then you can click this run
SQL command line okay I click run SQL
Comm command line then you just
type there's some command called connect
okay you just type
connect then it ask for the username
usern name as the default is be now we
are going to use system because we don't
have any other accounts created now okay
and the username is system and the
password is whatever we provided in this
stage actually so whatever we provided
here the password you should provide the
same thing here so I'll just provide my
password okay it's connecting okay now
this prompt means everything
installation was successfully completed
and
you you connected to the database from
the master account okay so now as I said
now my next start is I want to create a
user okay so I'll create a the Syntax
for creating user is this is the create
user then this is the username part
identified by and this is the password
so for example I want to create a user
with the username hpur and password is
test 1000 okay so this is when you
create a user it will automatically
create a schema for that specific user
okay now I'm going to copy this one I'll
paste here okay I'll just go here
edit paste
okay okay now this created a username
called HP and the password is test 1000
okay now my next next job is I want to
Grant permission for this user so that
this user will be able to do the uh
required task in the database okay so
this is actually grant grant and this is
all the permissions I need for this
specific user I'm giving session create
all privilege alter session privilege
create database
link procedure creation all these what
most of these permissions are very much
required for this user actually okay so
I'll put this one and also in the last
I'm just using the same username I
created here actually okay so I created
a user hpu so I'm going to Grant
permission for the same user okay so
I'll just take this one I'll
copy okay and I'll go
here I'll go to this
screen and press enter okay so it says
granty succeeded so we reach the stage
we create
we install Oracle we created a user
means it will already once you create a
user it will automatically create a
schema for this one then I have given
the permission for the this user to
create table and other things okay now
let's go with the let's start with toad
actually so toad is a database
management application widely used for
Oracle okay so first we'll go and
connect to the database whatever we
created okay so session we connect okay
for this the connection setting is is
like you see I'll just explain the
connection settings uh so it is like
this
one okay so this is a syntax if you want
to see and this is the protocol and
everything our host name is Local Host
the port by default is 1521 and for this
database Express Edition always the Sid
will be XE okay so you just past this
connection settings okay and you use the
username whatever we created okay us
name we created is
HP okay and the password we created
is it's here I just paste the same thing
okay then it will allow me to log into
the
database okay so it's just because the
first time it is just creating certain
things
okay uh okay now we logged into the toad
actually if there is something wrong it
will not if the if there was some error
or something issue and you're creating
or granting permission then it will not
allow you to log in this user into the
tool okay okay now my next thing is like
I want to create a table then I want to
create a package and I want to create a
procedure so I'll show you the if you go
here in this one like schema browser you
will see that the now I am in the schema
called uh this is schema HP okay so I'll
create a table here and the this schema
and then after that we'll create
a after once you I create a table I'll
create a package and we will go on okay
so now to creating a for creating a
table you just click this button create
table okay I'll give a name for this one
so I'll give a
name employee for example okay then I'll
going to add a column I'll put it here
employee ID then I data type as a number
okay then I put it as a private key
primary key then I make it not null okay
then I'll go for a second
colum I'll type the
name employee name then I take it as a
workare two and I'll put the size some
200 characters
okay so and this one is over and I'll
make it not null then I'll go for a SE
another
parameter
employee
mobile then I'll take it where care to
then I'll put it like 50 characters I'll
say not now I'll
put employee Department
and I'll just say
to
50 okay so is up okay now my database I
have just uh created the table okay so
what I can do is I press okay
then what I can I'll just refresh it so
you will see this is here actually so
what I can do is first thing I want to
make sure the constraint uh yeah is
already employee ID is the constract is
fine then I want to create a auto
numbering Auto numbering means when I
enter the data I want this column
employee ID column should be incremented
by One automatically so I'll just go
here I'll click just because this is my
employe sequence I'll just press okay so
it will go on okay so now my job my next
job is like so now we I reached the
created a table
employee okay and and uh I have created
added the index and everything I created
a primary key and I also added a trigger
okay so if I want I can add also some
data I'll just go here data employee
name then employee mobile I'll put one
two three some number and employee
Department
computers
Sorry by mistake I press something okay
go here
okay my department is computer I can
press okay okay and if I want one more I
can add another one you see you are this
number one is automatically created on
submission of the data okay so now I'll
create another
name
Lou okay the mobile number I just put
some number we also for the Department
computer okay and this is just sample
that so I I'll commit this one
okay okay now to create a package
actually so what I'll do is I'll just go
to the I'll show you show some sample
codes okay so the package you it should
have something called package
body and the package content so what
I'll do is like this is the script
actually what I should I'll be going to
use so first I'll create a package
called
h.m means m is the package name HP is a
schema okay so I'll just have a one
sample procedure now what I want to do
is I want to create a procedure called P
employee where I'll be passing the
department of the employee and I want to
get a list of list of number of Records
it may contain multiple rows so I'll be
using a s cursor okay so this is my
package and this is my package body
actually so package body this is
container just the definitions okay and
this will contain the actual procedure
okay so let me create the package now
first okay I'll run this
command okay then it is created now if
you go
here if you go here you will have this
package yeah it's here okay now it has
only specification so I want to also to
have the package body so package body is
this one I'll just run this command
so yes it's run okay now I'll go here
and I'll see it should show
me okay now if I see now this this is my
package and this is a package
specification and this is the body so if
I double click here I'll be able to see
both the things actually and I'll also
be able to edit if required okay so you
see this is the whole
package
and okay so this is the
package uh this is a package
specification okay so this is I'm just
defined one procedure here where the
procedure name is p employee and I'll be
passing in input parameter as P
department and I'll be taking out the PM
list as the ref cursor output okay and
the actual the this one procedure is is
here okay that is the specification is
the package body okay so it will be here
so I'll be opening this is cursor here
and I'll be using select star from
employee where employee department is
equal to P Department which is a pass
actually okay so in this uh the next
part of the tutorial I'll show how to
connect this procedure uh into visual C
using Dapper and Oracle data manage data
orle manage data access
client hi this is part two of my video
tutorial in the part one I have I have
shown you how to install Oracle
Express create a schema create a table
create a package okay using Toad and all
so this is the part two actually in the
part two what I'll do is I'll just
create a new Visual Studio 2003 project
using C then I'll create a model and
I'll create a controller then I'll add
some
dlls uh and I'll just basically I'll
show you how to use Oracle store
procedure using Dapper and Oracle manage
data access client okay so let's start
I'll just make it very simple this is
just a working solution so that you can
go take it to the any any level you want
actually in the future okay so I'll just
start a new
project I'll select visual
cop then I'll elect web us.net I'll put
like
anif Dapper ODP okay I'll put this name
press
okay select MC because I just want to
create a basic stru yeah so project is
ready let's go
to models I'll add a model
called add a
class okay and I
put
employee this is my model
okay so I'll just add this an employ one
okay just very simple public
string okay what is that it is the
employee ID employee
name employee
ID then
get then I add set okay then now I'll
add another
one
public
Str then I add employee name
okay
employee
name
get
set I want to show you one more shortcut
you can just type prop tab tab so it
will add these things actually much
easier actually so you can just type
here then
employ
underscore what is the name it is
employee mobile and employee Department
I'll just put employee mobile okay then
I'll add the same
time
employee department so it will be
employee Department okay let me check
yes it is Department okay so my model is
ready now so model name is employee okay
so I'll just click
build but before that I want to make
this one is my
key okay so so it's G me some f okay you
need to do some okay you should use this
data
annotations resolved okay also if you
don't want you can also remove this
additional default using statement from
here go to organize using and you can
use remove unused okay so because other
things may not be required okay now we
just go here and build your solution
okay so you compile
it
okay okay now let's go and we'll have
the we have a controller here home
controller okay so in the home
controller itself I'll just add uh okay
so what I'll do I'll add something
called I'll take one of these samples
and I'll just go here okay so I'll just
add like employee
okay okay so here I'll create I'll
initiate our
model so model is okay before model is
employee
then EMP is equal to
new employee okay so it's giving an
error because I think I not so just take
it to this place
it should be
because I need to use
using name rapper dot models okay then
it will be fine it should be fine okay
going because I not added the using
statement okay so now what I want to do
is I'm any when I go to this page I
basically I want to display all the
employees is available in this table
actually from here I want to bring the
data here okay so for that what I'm
going to do is I'm just going to first
I'll so let me wait here
actually waiting for
function to be ready okay okay so for
this what we are going to use is we are
going to use Dapper and Oracle manage
data access so first thing let me
install Oracle manage data access from
the new get okay go
here I'll just
type Oracle manage data access okay just
search for
this hope it will come fast sometime it
take
forever okay so I search for Oracle
manage data access and I'll install this
first one okay Oracle manage data access
I'll install this
one
okay okay now I have created we need to
install Dapper okay so Dapper is
a uh micro I think you you will get uh
that Dapper all these details you can
find it in
the uh uh new get or you can just Google
it for Dapper net actually okay so you
can install Dapper net directly from the
newg but the problem is like you need to
add three four files to additional files
which is required for the to operate so
what I did is I have created a dll so I
can just going to refer it here so that
I don't need to install many things like
so I'll just go
here well then add a reference okay I'll
just go
here what I'll do is is I'll go to my
folder
person
CL not okay so this is my
file let
add okay so this is my Dapper okay so
added a difference okay so now what I'm
going to do is I'll create a for all my
this
one for my all the function files to put
everything in one place so what I'll do
is I'll go here and I'll create a
folder okay and the folder name I'll put
it
as
utilities okay so inside the utilities
I'll create a file
called function okay it will be a
function
file I'll just put the
name function do
CS okay okay so this is my function okay
so
now what I'm going to do
is okay so I'll have a sample I have a
sample function so I'll just get it from
there so where is my sample okay so this
is my for
example take from
here okay so uh here in this this is a
sample
function I already have actually so what
I'll do is this is my
employee Okay one minute what is that so
I'll just take from the
here okay this is my
model so I'll just go here I'll add
employee okay then I'll have this one is
also
employee this is okay so before that let
me Pro solve these problems actually so
here it says
you have you need to add the model so
I'll refer the model okay then now it
says here I I need
to refer to
the add the name space this one for this
I need to use system data okay for this
I need to use Dapper is already there
because I created that D okay now for
this one this is my employee
okay
okay so what I can do is I'll create
ml okay this is thing M and M
okay so basically what this function is
doing is like uh this function will
return a group of employees okay and
I'll put this
one the name of the this one
is mcore list okay this is the name of
the function and I'll be passing the
department
actually P okay before that let me go
and check what are the parameters
required for this package I defined here
okay so if I go here I think you will
see it here yeah okay so in my this one
I defined a parameter called P
Department which will I'll be okay so
this is my parameter P Department okay
another parameter what it will give
output is PM list so I'll add it here
this is my output PM list okay so and
also the procedure name what I'm using
is
hpor do
EMP okay this is
H
put. EMP
dot P employee I'll just put it
here okay so this is my procedure name
okay and this is the parameters I'm
setting and this should have the P
Department actually change the name p
[Music]
Department okay and this is the P
Department okay so this is my
by sample procedure actually what it
will do is this is a function this
function will
communicate with this procedure in the
Oracle database okay and this will
use like okay DB so this one we need to
De Define in the web. config okay the go
to web. config okay so first you need to
have this Oracle connection here
so okay I need to disable this default
connection I I should add this is the uh
default SQL connection I don't need it
I'll just comment it out okay now I'll
take out uh I'll use this connection
string
okay go here I'll add this one okay so
this connection string it is Oracle and
and it is referring to the Local Host
because my server is here this is my
port number and
this is my schema US service name is xe
and this is the username I'm using HP
and this is the password which I have
created for this okay and also for one
more thing you need to add you need to
add app settings name this is
a app name so this is important also
okay then when you have this
[Music]
okay so Al all these things you don't
need to have you can just disable these
things
actually you don't need
this you don't need this and you don't
need this okay you can comment it out
okay okay so now I'll just
um okay now another thing like our
controller is ready now uh we created a
function so we need to use this function
actually so I'll just call this m list
in the home okay we I'll Define m isal
to
functions
dot so what I'll do
is I'll use this utility folder here
using
do utilities yes okay now what I'll do
is function dot okay mlist okay and I
need to send a this one called
Department okay so what I'll do is this
time I'll just send a
department computer I'll hardcode it but
actually you should send it
programmatically okay like here in this
one I have some I have created some
records let me check what records I have
so that I don't need to okay I have
created employee Department computer
okay so I'll hard code this one for this
time but usually you can okay computer
okay then I can set
this why
y function
dot employee
solution
okay okay the name is
expected this have some issue
here this is something
extra what is the error
so it
says function. imply
list of I need
to
send a
string so string
is the
department okay
then I can
put department is equal
to
computer
okay so it should work fine I believe
no why why
am placed okay then I will be
[Music]
sending ah okay so the problem
is here I am using okay I got the issue
because in the function what I'm doing
is this is the list okay this is the
list of items okay so you expect a list
but your model is not a list so what I
should do is I'll go here and I'll
convert this one to a
list
okay and I'll make this one least now
I'm I should it should work more
okay yes okay okay now it'll work
actually no issue I don't have any issue
so here I I hardcoded this one but uh
you can use no need to hard code okay so
now I'll just send this one to this
model to the view
okay okay now we need to create an
employee I need to create a view
actually to display this one so I'll go
here I'll add a
view and I'll just create without any
model so I'll add it
myself so it's creating my view okay so
I'll just type at model is equal to what
is that
ippp do
models dot
okay models
okay then I go here so I'll just copy
paste some I have some ready codes I'll
just copy paste so that I don't need to
waste your time in
Waiting okay so I'll just take this much
okay
okay okay so what I also I want to do is
I want to put list of this
one
models so I just add this
okay this is my model okay so this is
not a problem it's a view bag I don't
care this
is employee list okay so what I'll do is
if the model is not null then I'll just
use it's fine it's fine
okay so we just check
here okay now I'll add this uh view
actually here I'll be adding my model it
is the list of employee because if you
go to the employee it is a single data
so I'm converting into as a list okay
then I'll be using this table where I
want to
display like in a taable fashion I want
to display the row number and the
employee ID department and employee name
so this will actually Loop it if there
is 100 records it will show 100 records
if it is one record it'll show one
record okay so and also I put a title
employee so basically what happens is if
it's if you go to here so let's like
okay I'll just put a break point show
how it
works
okay so this is one break point and I'll
then I'll just put one more break point
here to show you let's hope this will
work and let me run this
one
okay so I'll just go
[Music]
here okay just click this one open it my
Chrome
let me
compile so okay so I put a break point
so it should supposed to come and stop
okay so so now it's coming the I'm just
trying to access this employee so it's
coming to this stage okay so it's
initiating the model I'll go here okay
go here then it's trying to get the data
okay so now it's hitting the function so
we'll go here so you see now I'm sending
actually I'm sending the parameter
Department as computer okay so you'll go
here so this is the my ref cursor for
getting the data okay you'll go here is
hitting the you see now it is hitting
this procedure this procedure is here
actually
so it is hitting this procedure okay and
it will get this data okay now let's see
like you see what will happen if you go
here and the debug and you can see now
many you see you can see this the
parameters let's watch
okay okay you see now it's is already
have the data okay it has number two
records actually count is two means we
have only two records here and if you go
to the schema of the tables you have two
records okay so it is showing the two
records good so I can even like expand
this and see what are the records you
see this is showing the same data from
there is good let's go here let's next
next okay so this is is going to the
model now I'll just press
continue and see how's the
display okay yeah okay so this is the
data it is coming from the okay so here
it is there are two numbers because one
is from the
okay so what and all I have I have
employee name employee mobile employee
department but I forgot to use in my
this one okay employee Department
employee because I already have an ID I
don't need two IDs what I can do is I
move this here okay then I'll
add
employee mobile okay
so I'll just sa okay I'll refresh
again should show the mobile number from
there actually yeah so this is the
mobile number this is the department and
this is uh this one but one thing I miss
is there is no heading actually so what
I can do is I can go here and I can add
some adding actually so for example I'll
take this one
I'll take this and I'll add where is my
table
okay so this is my
ID you say employee
ID
Mobile then
[Music]
department and I can add name okay so I
have a table adding because I will be
confused with what exactly the columns
okay so now if I go here should show
me yes so is here actually this is the
employee ID the mobile this the
department the name okay now to show
what I'll do is I'll just take this and
I'll duplicate row and I
put this is
L is two and this is some other number
okay this is
computer then I'll make another
duplicate of this
one
true
two some number I'll put I'll put it
Department okay so I'll make another one
duplicate and if three
okay then I put something I'll put
computer okay so now what happen is I'm
just I'll update this one so if I run
this query now it should show me like
because I'm querying only for the
Department computer it should show me
four records okay so let's check so
before that let me commit this changes
okay I'll go here I'll press
employees press continue
yes yes good so it is showing only
the employees from the Department
computer
okay I hope this will uh cover the basic
concept how to connect Oracle
Dapper to
the
Dapper from asp.net MBC sh Visual Studio
20033 to or
11 database okay hope you enjoy this one
and if you have any comments or any
problems please leave the comments box
down so I'll be able to help you out
thank you and have a great day bye-bye
[Music]
a
[Music]

Video Length: 41:32
Uploaded By: Mahammad Haneef
Published: 9/21/2016
View Count: 11,256

Related Software Products
dbExpress driver for Oracle
dbExpress driver for Oracle

Published By:
Devart

Description:
dbExpress Driver for Oracle: Connect Delphi to Oracle Without Installing Oracle Client dbExpress driver for Oracle is a Devart driver that connects Delphi and C++Builder applications to Oracle through Embarcadero's dbExpress framework. Its Direct mode works over TCP/IP with no Oracle Client on the PC. It costs $229.95 at checkout for one developer. Anyone who has rolled out Oracle Client to a few hundred desktops knows why that matters. With...


Related Videos
Install Oracle DB Express 11g R2 &  ORACLE   APEX
Install Oracle DB Express 11g R2 & ORACLE APEX

Video Length: 02:58
Uploaded By: abazar hassan (7/28/2015)
View Count: 5,215

How to Install Oracle 21C DB Express Edition (XE) on Windows | Connect via SQL Plus or SQL developer
How to Install Oracle 21C DB Express Edition (XE) on Windows | Connect via SQL Plus or SQL developer

Video Length: 14:29
Uploaded By: ETL QA Labs (12/12/2025)
View Count: 2,579

Copyright © 2026, Ivertech. All rights reserved.