.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

MVC3 with oracle

Posted By:      Posted Date: May 22, 2011    Points: 0   Category :ASP.Net

I'm testing out the Oracle Beta ( with the entity framework (4.1) and MVC and running into a couple problems.

I figured the easiest test would be to take a completed project (MVC music store tutorial on this site) and try to convert the connection string of the DBContext object to point to an oracle server populated with the tables.  Initially I had a problem with the default schema name of "dbo" which I overrode in "OnModelCreating".  Now that it is pointing to the right schema/table I get an 'ORA-00904: Invalid identifier' error.  I think this is due to how the LINQ query is being processed.

The inner exception is "ORA-00904: \"Extent1\".\"ArtistId\": invalid identifier" and the value it shows for my DBContext object is:

 CAST( "Extent1"."ArtistId" AS number(9,0)) AS "C1",
"Extent1"."Name" AS "Name"


I think the problem is with the extra quotation marks around everything; If I get rid of those I can run the query in Oracle.  So basically I want to know if it's possible to override the formatting of the queries through the DBContext object to lose the quotation marks or some other way to accomplish the same goal.  I appreciate any help you all could give me.

View Complete Post

More Related Resource Links

Problem upgrading to MVC3 - System.Web.Routing



I'm trying to upgrade to .NET 4 and MVC 3.

When trying to compile my project, I get the error:

Error 1 The type or namespace name 'Routing' does not exist in the namespace 'System.Web' (are you missing an assembly reference?) C:\Users\spencer\Desktop\weblauncher\Common\MVCConfig.cs 4 18 Common

The type or namespace name 'Routing' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)

I do have the System.Web.Routing in my references for the project.

BUT - when I try to view System.Web.Routing in the OBJECT BROWSER, nothing is inside!  The System.Web.Routing namespace is not in there - the entire thing is empty!  Could it that the dll is corrupted?  I tried to reinstall the .NET 4 and MVC 3 stuff, but its still empty!

The dll is coming from here:

C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Web.Routing.dll

and the runti

Need Oracle Data Provider .CS File for Oracle 10g Database connection !



I need a 'Wrapper.cs' file which takes care of the Database connection ( Oracle 10g) where

i can just call the method with my SQL Query


Gridview1.DataSource = SampleWrapper.ExecuteDatatable("THE SQL QUERY");


Plz Post the link if there is any open source !    

Will MVC3 make possible to use IOC with Action Filters



Will MVC3 make possible to use IOC with Action Filters?

Is this on the roadmap?



MVC3: Define Dynamic ViewModel property inside Action Filter



How can I define a Dynamic ViewModel property in MVC 3 inside an action filter?

I am looking to have something like but inside the ActionFilter and not in the controller:

ViewModel.Title = "Home";

Thank You,


ASP.NET MVC3 Areas and Razor views produce errors?


The view at '~/Areas/SomeArea/Views/List/Index.cshtml' must derive from ViewPage, ViewPage, ViewUserControl, or ViewUserControl.

The project structure is pretty much default. There is one area called SomeArea. It has a single controller called List. It does nothing except:

public ActionResult Index()
    return View("~/Areas/SomeArea/Views/List/Index.cshtml");

The view looks like:

@inherits System.Web.Mvc.WebViewPage<dynamic>
    View.Title = "Index";
    LayoutPage = "~/Views/Shared/_Layout.cshtml";


I have tried emptying the entire file part by part and nothing seems to help. If I create a controller and view outside the area it works just fine. If I create an aspx view it works fine as well. Is it possible the default razor view engine doesn't support areas at this time?

The areas are registered too.

public static void RegisterRoutes(RouteCollection routes)
        "Default", // Route name
        "{controller}/{action}/{id}", // URL with parameters

ASP.Net connect to Oracle.


 We have an application which uses  'System.Data.OracleClient'. On the box it was developed we can change the TNSNAMES.ORA entries to connect to different oracle databases. Moving the code to a  Microsoft Server 2008 box it would appear that the application ignores the TNSNAMES.ORA file. It has cached the first Oracle connection and will now work without any TNSNAMES.ORA file. Where is it getting the connection? We have set tns_admin to point at the TNSNAMES.ORA file. We can tnsping the connection OK.

access Oracle database


Pre- .Net Framework 4.0 supported using Oracle.DataAccess.Client, using Oracle.DataAccess.Types, System.Data.OracleClient, OracleDataReader, OracleConnection. What are the equivalents in .Net Framework 4.0? Does it require any download?

Thank you.

Trying to run a stored procedure from vb code with oracle data provider.



Here is my SP:

create or replace
 Open p_getuserssignon_recordset1 for
 SELECT Distinct(Userid), UserPassword, SecurityLevel, ActiveStatus
WHERE substr(UserId,1,2) <> vUid
Order By UserId;

I would like to run this SP from code and fill a gridview with the result. 

I am not sure how to go about this, as I have found several different examples, other than the one I  think I need.

I am using the oracle data provider and I have an input parameter (vUid, which will equal "zz").

First question. When filling a gridview with a result set from a stored procedure should the recordset OUT be defined as a REFCURSOR (like i did above)? 


Do you have example code as to how to execute the SP and fill a gridview?  I keep trying different variations of code i've found on the internet without any success other than getting more confused.

(I am using VS 2005, VB).

Thank you.



Linq with two databases (oracle and sql server)


i have a problem to bring the data from the oracle (external database) and the sql server together (with similar data). The linq entities are linked to each other. The structure is like different countries with different cities and so on. To display these "non original linq objects" i need to put them into entities (linked to each other). Now i add some of them to my sql database. But for every entity i must check the connection to the other objects i don't want to add and delete them (otherwise linq will add all the connected objects, even those I don't want to add). If this goes wrong the whole input-method crashes. Is there any other possibility, except from checking every single entity and removing unwanted connections, to handle this procedure?
Thanks a lot, preg

DataTable --> Oracle DB



Can someone offer advice on the below? 

I am connecting to an AR Server and pulling out data into a DataSet.  There will be 15 different DataTables within the set.  I would like to find a way to either insert the entire DataSet or each DataTable into an Oracle table.  The Oracle table has the same format as the DataTables I'm creating.

 private void button1_Click(object sender, EventArgs e)
                //Get Credentials
                ID = userNameTextBox.Text;
                PW = passWordTextBox.Text;

                connString = gstrConnectBaseLineStart + "UID=" + ID + ";PWD=" + PW + gstrConnectBaseLineEnd; //Connection string
                conn = new OdbcConnection(connString); //Create Connection
                conn.Open(); //Open Connection
                Console.Write("Connection Successful" + "\n");

                dataAdapter = new OdbcDataAdapter(SQL, conn);
                dataAdapter.Fill(IncidentsDataSet, "dataTableTest");

                DataTable dataTable = new DataTable();
                dataTable = IncidentsDataSet.Tables["dataTableTest"];

                dataGridView1.DataSource = dataTable;

                //Would like to create som

Connecting to Oracle on 64bit OS

We have a 64-bit implementation of MOSS 2007. I recently installed the SharePoint SDK to use the Application Definition Designer to connect to Oracle. I enter the connection string and then I get this:

Attempt to load Oracle client libraries threw BadImageFormatException. The problem will occur when running in 64 bit mode with the 32 bit Oracle client components installed.

I have verified that the server contains the 64 bit version of the Oracle client installed both with the instantclient and with system.data.oracleclient.dll. The only thing I can think of is that the tool was compiled as a 32bit application.  Is there a 64bit version available? Is there something else that I'm missing?

"An error occurred while retrieving data from Oracle Instance..."


I have succeffuly Imported the ADF and have also successfully created a Business Data Column. But when I try to query data , I get the following error

An error occurred while retrieving data from Oracle Instance. Administrator, see the server log for more information

And this is what I found in the Application Logs
A Metadata Exception was constructed in App Domain '/LM/W3SVC/81256521/ROOT-1-129217212004078822'. The full exception text is: LobSystem could not be found using criteria 'id=476'.

Secured Oracle Provider



Ours is a Asp.net web application. Database is Oracle. Its an Internet Application.

Database will be in one location and Web application in another. Data from Oracle to Web application will be passed over Internet.

We are using EnterpriseLibrary. And provider is System.Data.OracleClient.

We need a provider which encrypts the data while passing data over internet.

Do we need to go for some third party Providers or ODBC ?

Please let me know..


What's wrong with MSDAORA.1 (Microsoft OLE DB Provider for Oracle) in SQL2008R2

Dear Gurus, I'd install a test SQL2008R2 on Windows Server 2008 R2 x64 Version. And Install Oracle both x86 and x64 version Client. And I'd create a new AS Database as AS System Administrator. And then create a new Datasource with "Microsoft OLE DB Prodiver for Oracle" Provider. When I test connection ,  it tested succeed. Then I create Datasource View / Dimension / Cubes etc... But when I process then Database. There is a error occurs. "Database Access Module Error , Provider 'MSDAORA.1' not register" I'd follow http://msdn.microsoft.com/en-us/library/ms152516.aspx change SQL Server 2008 R2's registry key as the note. Then restart this server . But still same error !   And I'd success process the cube if I change provider as "Oracle OLE DB Proverder"   Is MSDAORA been obsolete in SQL SERVER 2008 R2 ?Wilson

Oracle Linked serve Query performance in 2000 vs 2008 R2 64 Bit

Hi everyone We have started to migrate one of our reporting systems from Sql 2000 to Sql 2008 R2.  One of the steps has been to test the perforance of certain Oracle linked server queries between each server.  We are finding on average 3 fold better perforance stats (in terms of query completion time) on the old server.  This should obviously not be the case.  The new server has signifantly more CPU/Memory/IO resources to play with, and it is 64 bit (not to mention its new!).  Here's what I got so far: Old server: SQL 2000 on W2000 both fully patched.  Old Dell Dual core with 3 GB of Ram running on two soft IDE Mirrored drives (yes I know... it sucks).  It connecting via the MS OLE DB provider for Oracle (9i client) New server: ESX VMware Server with 2 CPU's assigned, 8 GB of ram connected to large HP SAN.  CPU, ram and IO's have all been ruled out as the problem.  We've tried varying network cards with different results so we havent ruled that out yet.  Its connecting via the Oracle provider for OLE DB (11G 64 bit client) The linked server is an Oracle 9i fully patched server.  All three are on the same network backbone. Running a simple select * query on both servers returns the same number of rows (~76 000) .  It takes ~1:20 on the new server and ~0:20 on the old server. In looking at the wait stati

No Way to retrieve data from oracle ref:_cursor over T-SQL and linked Server?

Hello, for an migration projekt we want to compare results from sp's from oracle and sqlsserver. Same calls should retrieve same results. Also we want build an automatic test for this. But is there now way to retrieve results from oracle sp's whit rev_cursor over linked Server? No one answer to this: http://social.msdn.microsoft.com/forums/en-us/sqldataaccess/thread/2BAC6743-8701-4476-8F36-0377A5761525   greetings Michael

I am not able to install oracle 10g on windows 7, Please let me know how can I do it or what could b

Dear Concerned,I have really become fed up while using windows 7, Please let me know how can I install oracle 10g and which of the version of oracle, windows 7  will accept so that I could start work on my laptop ...Thanks and RegardsRahul Kishan
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend