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();


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

    Wednesday, October 6, 2010 9:00 PM


  • 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 :



    • 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