I have an application in which I am using a stored procedure and LINQ. My procedure looks like this:
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
I am executing this stored procedure in LINQ. When I execute it I am getting the results in IMultipleResults.
Below is my code in LINQ:
[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;
}
When I execute it as follows:
MyContext mCtx = new MyContext()
var allResult = mCtx.GetMultipleResults(txtName.Text.Trim());
IEnumerable<Taba> TabaRes = allResult.GetResult<Taba>();
IEnumerable<TabB> TabbRes = allResult.GetResult<Tabb>();
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...
... to try to find a solution to my problem, but couldn't find any.
well better to use views in respect to SP(If u are not able to write a linq to sql query),if u are using Linq to Sql its worthLess to use Sp becoze it decrease the performance.and one more thing if u are using Linq to sql there is no Need to use any type of join if ur data base is completely normalized. If still ur prob is not solved just show me the table structure and what the out u need i will write a query for u...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With