Click here to Skip to main content
15,893,564 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Team,
I wanted to learn MVC Architecture and database connectivity. I dont want to use EF or LINQ. So in accordance with plain ASP .NET connectivity code, can anyone please help me for that.

Consider Following point:
1) No Entity Framework and No LINQ.
2) Simple SQL Client objects, SQLConnection, SQLCommand, SQLDataadapter etc.
3) and Perform Insert, Update, Delete, Select ...operations as their ActionResult in the controller.
4)How to create connection string.



Microsoft Visual Studio 2010 (Professional)
MVC 3 (RAZOR/ASPX)
SQL 2008 Management Studio R2




can any one please provide me a newly created step by step tutorial ....so that i can have a clear understanding..!!!
please..!

thank u
Posted
Updated 14-Oct-13 23:48pm
v2

1 solution

The best way is to create a multi-tier solution.

One project containing poco's
One project data layer that references the poco's
One project (business or something) that references data and poco
One MVC Website website that references business and poco

Your website retrieves a request
The request want (for example) a list of products
It starts a new instance of a products business class in the business project. This class checks if everything is fine (enough permissions and stuff) and then instanciates a products data object.
This one queries the database and converts the query result in (a list of) poco object(s). This will be returned.
Your business will also return the (list of) poco(s).

This leaves you with the poco's right there, in your controller. Pass them to a view and you're happy.

Cheers,
Eduard
 
Share this answer
 
Comments
thatraja 10-Oct-13 8:42am    
Good, 5!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900