ASP.NET MVC + Oracle: samples and how-to - asp.net-mvc

While reading NerdDinner, and browsing other examples on the internet regarding ASP.NET MVC with LINQ To SQL.
In my ASP.NET MVC project I have to connect to an Oracle database. The main goal of the application is to display, edit, and update data. I am uncertain if ASP.NET MVC can work with an Oracle database.
Has anyone ever done an ASP.NET MVC project with Oracle as the database?
Are there any articles with sample code that you'd recommend?
What are some easy ORMs or data access strategies that you'd recommend an ASP.NET (webforms or MVC) project use to communicate to an Oracle database?

You can use Nhibernate to get access to your DB.

ASP.NET MVC can certainly support Oracle or any other data source behind the scenes.
MVC is not tied to Linq to SQL in any way. It's just one convenient way (among many) to get data from a datasource into your models.
As Sly pointed out, NHibernate is one ORM framework that will work for you.

Related

2 issues about ASP.NET MVC,LINQ to SQL

Describe the Advantage and Disadvantage of ASP.NET MVC in comparison with ASP.NET Web form.
Depend on your choice to implement a new design or develop and compare source code or just explain the concept idea, the tasks of LINQ to SQL class that using as ORM, make comparison with NHibernate on the concept of developing the Data Access Layer for the application.
MVC is a popular standard. I recommend using ASP.MVC than Webforms because it has all the advantages of MVC Architecture. and you can use many view engines such as Razor and NDjango.
For ORM you should use Entity Framework. It's really a wonderful framework.
The advantages of New Products such as ASP.NET MVC and Entity Framework is that THE OLD PRODUCTS SUCKS and the disadvantage is the you need to LEARN AGAIN.

ASP.NET MVC with ADO.NET DataServices

In the project i am working on, i want to use the ADO.NET data services as data access layer. so that other parts of my application (except asp.net mvc web site) could also access it from the same location. I am just not sure if this si the correct model and also for asp.net mvc models I wanted to reuse the data services model, as much as possible and also some how decorate them as required fields etc.
Other option i started looking at was to use RIA services as back end to the MVC site.
I am very confued at the moment and any help would be appriceated.
Have you taken a look into WCF data services?
http://msdn.microsoft.com/en-us/data/bb931106.aspx

Asp.net MVC with SQL Server stored Procedure

I am an asp.net webforms developer and new to asp.net MVC....
Is it possible to use SQL Server 2005 stored procedures in asp.net MVC?? If so can any one help me....
This is absolutely possible. Although it claims to be a Model View Controller framework, ASP.NET MVC is really just View Controller, it's up to you the developer to decide and implement a model persistence layer.
As a WebForms developer you're likely familiar with DataSets, however these are usually avoided in an ASP.NET MVC application in favour of an ORM framework like NHibernate or Linq2Sql, both of which have plenty of resources online for integration with ASP.NET MVC. As a good starting point, you might want to look at S#arp Architecture which is a good example of a best practice MVC stack.
Using stored procedures is not directly related to which type of application you are building. You could use the same type of data access code as you are used to from WebForms, such as ADO.NET (SqlConnection, SqlCommand etc.).
Absolutely agree with answers above, my advice is to use Entity framework or LINQ2SQL and simply import stored procedure as function which you can use as dbContext.Somemehto();
Stored procedure should only be linked with Model that is pure sever code, so there is no difference in using it from Desktop application or from Model. If it is not distributed database.

What is a extensive ASP.NET MVC sample app that uses the entity framework?

Can anyone suggest an ASP.NET MVC sample application that uses the ADO.NET Entity Framework against a many relation sql server database?
Most of the sample apps I've seen work against a really simple database with just 2 or 3 tables. I'd like to see the code behind an app that shows more than just the CRUD code to just one table
Thanks for any suggestions!
Rob
You might want to consider an example that has been built using ASP.NET MVC and the Entity Framework using the Northwind database, which is a pretty good representation of a typical business-type database.
Also, if you're not familiar with the web site already, ASP.NET has some great resources for ASP.NET MVC.
Rob Conery StoreFont is a good point to start looking, but it's done with L2S (not much diference anyway)
Source Code here: http://www.codeplex.com/mvcsamples/Release/ProjectReleases.aspx?ReleaseId=18861

Choosing data access methods in ASP.NET MVC

As I am a beginner to ASP.NET MVC, I would like to know what are the best data access methods for ASP.NET MVC?
This is somehow subjective. There's no such thing as best data access method for ASP.NET MVC. This will depend on your application requirements and specific needs. There are many different ORM frameworks you can choose from such as NHibernate, Entity Framework, Linq to SQL, ... (If there was a best framework this list wouldn't be so big).
As ASP.NET MVC is all about TDD and separation of concerns it is more natural to use any type of ORM for data access (NHibernate, Entity Framework, LINQ to SQL etc.). What type of ORM - depends on your project goals and experience.
If you're just learning MVC, and are ok with SQL server, then I would recommend using Linq to SQL for a start. Later you can then introduce more powerful ORM like NHibernate or EF. If you try to tackle MVC and something like NHibernate at once you will likely bite off more than you can chew.

Resources