Suppose I have two tables namely Person and Address, and also have their respective class defined in the business layer. Now I have a stored procedure that returns the result of the following query
Select Per.ExternalID,Add.Line1,Add.Line2 From Person Per
Inner Join Address Add on Add.AddressUid=Per.AddressUid
Where Per.PersonUid=@PersonUid
Now is it possible to fetch this result set using predefined sql-query. I tried it using return-scalar, but it returns the result in Ilist wherein each entry is an object[]. Meaning I get IList[0] as an object[]
that is object[] result = Ilist[0];
result[0] is ExternalID
result[1] is Line1
result[2] is Line2
as expected, but the column names are not returned here. Is there any other way I can get the result returned by the SP along with the named defined.
|