Possible Duplicate:
Can I use pure SQL in ASP.net MVC?
i asked a similar question in the morning , but didn’t get a simple answers ” up to my level”
what i’m trying to do is creating a website for my database project using ASP.net MVC
but i need to write SQL queries not LINQ-to-SQL . SO how can i write raw SQL in ASP.net MVC and WHERE ?! in the Model ?! can someone describe the steps in details PLZ simplfy it as much as possible. its my first exposure to the .NET framework
I would research the Repository pattern. Most examples you’ll find pair the Repository pattern with LINQ to SQL or Entity Framework but the pattern is generic. It can work with good old ADO.NET as well.
Scott Hanselman has a good post on extending the Nerd Dinner Repositories to use different data access methods (including classic ADO.NET):
Scott Hanselman – Extending NerdDinner: Exploring Different Database Options
That way you can structure the rest of your application the same way most examples show you but slip your own Repositories in to the mix to use your chosen data access method.