none
repository with stored procedure RRS feed

  • Question

  • Can anyone help me with setting up a repository with a stored procedure?

    I have linq to sql set up and I can call my stored procedure like

    ImagingDataContext db = new ImagingDataContext();

    db.LogImagingSlice(xmlSlice);

    but how would I put this call into a repository? advice/tutorial/pointer to code sample/snippet would be much appreciated


    chuckdawit
    Wednesday, October 6, 2010 9:00 PM

Answers

  • strSql="exec <SPNAME> Parameters";   //same as we write in Sql Server

     

    var queryRowCount = dc.ExecuteQuery<int>(strSql);

    foreach (var temp in queryRowCount)
                        {
                            pageRowCount = temp;
                        }

     

    Maybe  this one will help you ..

    For Clarification Refer To :

    http://weblogs.asp.net/scottgu/archive/2007/08/16/linq-to-sql-part-6-retrieving-data-using-stored-procedures.aspx

     

    Thanks

    • Proposed as answer by liurong luo Tuesday, October 12, 2010 8:43 AM
    • Marked as answer by liurong luo Wednesday, October 13, 2010 7:06 AM
    Thursday, October 7, 2010 6:48 AM