2 issues about ASP.NET MVC,LINQ to SQL - asp.net-mvc

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.

Related

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.

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

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.

Why would i use ASP.NET MVC over just a plain ASP.NET application

If i have to develop a small CRM application, why would i choose ASP.NET MVC application over a conventional ASP.NET application ?
Thanks,
Chak.
This post, "ASP.net MVC Vs ASP.net Web Form", summarizes some of the advantages of either model:
Advantages of MVC Model
1.Enable clean separation of concerns (SoC)
2.Enable full control over the rendered HTML.
3.Enable Test Driven Development (TDD) (built with TDD in mind).
4.SEO and REST friendly URL.
5.Easy integration with JavaScript frameworks.
6.Support third-party view engines such as NVelocity, Brail, NHaml.
7.No ViewState and PostBack events.
8.Follows the stateless nature of web.
9.Extensible and Pluggable framework.
10.Ideal platform for Web 2.0 applications.
Advantages of Web Form Model
1.Provides RAD development.
2.Easy development model for heavy data-driven LOB applications.
3.Provides rich controls.
4.Familiar model for windows form developers.
The choice really depends on your level of experience. ASP.NET MVC has a somewhat steep learning curve, but the extra effort should be worth it in the end. But for small internal applications, Web forms could probably get you there faster and easier.
Another article, "ASP.NET MVC Pro’s and Con’s".
http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller
First you might want to familiarize yourself with the MVC architecture pattern, and understand why using it can make your code better.
The short answer is that ASP.NET MVC encourages usage of said pattern.

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.

Have anybody compared ASP.NET MVC to CodeIgniter?

Is there a lot of similarities? I can webforms ASP.NET and some CodeIgniter but haven't much grokked with the asp.net mvc. Have they a lot of similarities?
Other than being frameworks build around MVC there aren't many similarities. (ie they both have folders for Models/Controllers/Views and automatically wire things for you based on naming conventions)
CodeIgniter is the most basic implementation of MVC possible, which allows for incredible flexibility when building your app.
ASP.NET MVC has alot built into it, and is strongly typed. LINQ to SQL provides a built in ORM and the basic MVC templates have frameworks for authentication built in utilizing ASP.NET Membership provider model.
Views in MVC are typed as well, so you have to define the model being passed into the view as opposed to CI which you can pass anything basically.
The helper classes are completely different as well.
ASP.MVC is built upon ASP.NET so alot of things will seem similar with Webforms, but you need to understand MVC pattern. Check out the NerdDinner tutorial for a fantastic introduction to ASP.MVC. (which is a Wrox book which they now make available for free online)
http://www.asp.net/mvc/learn/

Resources