how to convert sql stroed procedure to Linq,that shows exactly Code in Linq
Regarding this Which tool I have Prefer.
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Shivanand ArurPosted Nov 9, 2012, 5:44 AM
for example - This is a Console App example.
using System;
using System.Linq;
class MyNames
{
public static void Main(String[] args)
{
string[] Names = new Names[] {"Shiv", "Sai", "Ram"};
//My Linq Query to get the names.
var Allnames = from n in Names
select n;
Console.WriteLine("All Naes")
foreach(string s in Allnames)
{
Console.WriteLine(s);
}
}
}
Output :
Shiv
Sai
Ram
So in the same way, you can call a Stored Procedure using Linq. Check out these links...
http://www.codeproject.com/Articles/37938/Simple-6-steps-to-use-stored-procedure-in-LINQ
http://weblogs.asp.net/scottgu/archive/2007/08/16/linq-to-sql-part-6-retrieving-data-using-stored-procedures.aspx
http://debugmode.net/2011/06/30/learning-video-executing-stored-procedure-in-linq-to-sql/
Please mark the answer as accepted if it helped.
Thank you.