Click here to Skip to main content
13,350,486 members (62,637 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Hi I use the following stored procedure, but i do not know how i can use this with Linq to Sql.

I use the normal stored procedure with Linq to Sql, but this stored procedure retrieves data based on two tables.
How can I do this with Linq to Sql?
Please help me. Thanks in advance.

ALTER PROCEDURE dbo.PackageTestForPerform
        @Package_ID int,
        @Patient_ID nvarchar(50)
select t.dep_name,t.test_name,t.sub_test_name,
        SELECT COUNT(*) 
        from Patient_Package_Test p
        where patient_Id=@Patient_ID and p.test_code=t.test_code and p.Sub_Test_id=t.Sub_Test_code
),0)>0 THEN 'TRUE' ELSE 'FALSE' END AS [Status]
from packagetest t 
where package_ID=@Package_ID
Posted 9-Feb-12 20:03pm
Updated 9-Feb-12 20:31pm
Ravi Sant22.2K
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

use as

[System.Data.Linq.Mapping.Function(Name = "[TRNS].[Get_PRGoods]")]
       public System.Data.Linq.ISingleResult<PRGood> GetPRGoodsDetails(int PickupID)
           System.Data.Linq.IExecuteResult result = this.ExecuteMethodCall(this, ((System.Reflection.MethodInfo)(System.Reflection.MethodInfo.GetCurrentMethod())), PickupID);
           return ((System.Data.Linq.ISingleResult<PRGood>)(result.ReturnValue));

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web02 | 2.8.180111.1 | Last Updated 20 Oct 2012
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100