views:

64

answers:

1

Hi Everybody

I Have one application in it i am using stored procedure and LINQ my procedure is like

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 So when I am executing I am getting the results in IMultipleResults.

Bellow 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;
}

So

When I am executing like bellow

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. So I have refered many blogs and many forums like

  1. Ben Hall's Blog
  2. Guy Burstein's Blog
  3. Microsoft's Blog

Like Some................

And I tried to findout solution for my problem.

But then also I didnt findout anything.

With my all efforts and still I am trying to solve it too.

So In between if anyone will help me then i ll be happy and I will save my time.

Thanking you everybody in Advance.

A: 

Maybe this would be a stupid question, but in your store procedure:

select col1, Col2, Col3 from Tab1 inner join Tab2 on col1=ColA join tab3 on Col1=ColD

col1,col2,col3 are all from tab1, but you never did a select from the other tables that you are trying to do inner join. Did you tried

select col1,col2,col3,colA,colB...
-or- select * from...

DD_DD
Are you mad .......... I asked for solution in linq which ll solve my problem not asked for a query
Umakanta.Swain