Thursday, 3 July 2014

My First Use of Stored Procedures with LINQ to SQL

How to Use Stored Procedures with LINQ to SQL

try
        {
            MyFirstDataClassesDataContext db=new MyFirstDataClassesDataContext();

            var q = from p in db.Test_SD_TrTe_Details_fn("0000000175", "2014", "TR")

                    select new
                    {
                        name = p.Name,Address=p.Address
                    };

            GridView1.DataSource = q;
            GridView1.DataBind();
        }
        catch (Exception ex)
        {
        }

No comments:

Post a Comment