ASP.NET MVC data accessing using Linq to sql prodecure

saloj used Ask the Experts™
HI Experts,
I am using ASP.NET MVC for my website and trying to get data from database. I have already created SQL procedure on SQL Server 2005 and I would like to use Linq to sql procedure to get data and display on web site.

Thank you
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
you need to go for creating entitymodel diagram, in which you'll drag the table you need to access.

then using the basic linq syntax to fetch data you can display it on you website.

Tutorial is here:
Fernando SotoRetired
Distinguished Expert 2017

Hi saloj;

If you have not already created a OR/M, Object Relational Model yet you will needed to create one. In Solution Explorer right click on the project name and select Add -> New Item and from the Add New Item dialog box select Linq to SQL Classes give the model a name and click Add button. Once the design surface opens drag the tables and the Stored Procedure from the Server Explorer window on to the design surface and save your work. At this point you are now ready to write Linq to SQL queries.


Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial