I have storeProcesdure name called as prc_GetID, it's return value (ClientID)
Here thr proc Code:
Create PROCEDURE [dbo].[prc_GetID] (@ID VARCHAR(20))
AS
SET NOCOUNT ON;
SELECT ClientID FROM dbo.Clients WHERE [ID]=@ID
I use above STORED PROCEDURE with linq to sql, here's Code,
Public Class Form2
Dim dcClients As New dcDataContext(CNString)
Private Sub btnClick_Click(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles btnClick.Click
Dim CID = dcClients.prc_P(txtID.Text)
txtClientID.Text = CID.ReturnValue
End Sub
End Class
Here's My dcDataContext Code
<FunctionAttribute(Name:="prc_GetID")> _
Public Function prc_GetID(<Parameter(Name:="ID", DbType:="VarChar(20)")> _
ByVal ID As String) As ISingleResult(Of prc_GetIDResult)
Dim result As IExecuteResult = Me.ExecuteMethodCall(Me, _
CType(MethodInfo.GetCurrentMethod,MethodInfo), ID)
Return CType(result.ReturnValue,ISingleResult(Of prc_GetIDResult))
End Function
but it's return value 0 Why?,