Note that there are some explanatory texts on larger screens.

plurals
  1. POFetch n bind data from StoredProcedure with Join, LINQ then Split. using IMultipleResults,Linq2SQL
    primarykey
    data
    text
    <p>I have an application in which I am using a stored procedure and LINQ. My procedure looks like this:</p> <pre><code>myProc select col1, Col2, Col3 from Tab1 inner join Tab2 on col1=ColA join tab3 on Col1=ColD Select cola, Colb, Colc from Taba inner join Tabb on cola=ColX join tabc on Cola=ColY Select colP, ColQ, ColR from TabP inner join TabQ on colP=ColW join tabR on ColP=ColZ </code></pre> <p>I am executing this stored procedure in LINQ. When I execute it I am getting the results in IMultipleResults.</p> <p>Below is my code in LINQ:</p> <pre><code>[Function(Name = "dbo.MyProc")] [ResultType(typeof(TabA))] [ResultType(typeof(TabB))] ..... public IMultipleResults GetMultipleResults([Parameter(DbType = "VarChar(50)")] string i_Cola) { IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), i_Cola); return (IMultipleResults)result.ReturnValue; } </code></pre> <p>When I execute it as follows:</p> <pre><code>MyContext mCtx = new MyContext() var allResult = mCtx.GetMultipleResults(txtName.Text.Trim()); IEnumerable&lt;Taba&gt; TabaRes = allResult.GetResult&lt;Taba&gt;(); IEnumerable&lt;TabB&gt; TabbRes = allResult.GetResult&lt;Tabb&gt;(); </code></pre> <p>I am getting the column values of tables but I want the Inner Joined columns also. I've referred to many blogs and forums, such as...</p> <ol> <li><a href="http://blog2.benhall.me.uk/labels/Linq.html" rel="nofollow">Ben Hall's Blog</a></li> <li><a href="http://blogs.microsoft.co.il/blogs/bursteg/archive/2007/10/05/linq-to-sql-stored-procedures-with-multiple-results-imultipleresults.aspx" rel="nofollow">Guy Burstein's Blog</a></li> <li><a href="http://blogs.msdn.com/b/swiss_dpe_team/archive/2008/02/04/linq-to-sql-returning-multiple-result-sets.aspx" rel="nofollow">Microsoft's Blog</a></li> </ol> <p>... to try to find a solution to my problem, but couldn't find any.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload