I am new to writing Stored Procedure. So I wrote below procedure and want to access the output values in my program, hot to do it.
My Stored Procedure:
Create Procedure [dbo].[STP_ExecCarInDriver_SelectByCarCode]
@CarCode nchar(10)
As
Begin
SELECT DISTINCT
[MachineName]
,[FirstName]
,[LastName]
FROM [RoadTrs].[dbo].[ViewExecCarInDriver]
WHERE [CarCode]=@CarCode
End
and try with below code to instance to MachineName,FirstName and Last Name parameters:
var Results = rt.STP_ExecCarInDriver_SelectByCarCode(txtCarCode.Text);
string MachineName= Results(0).
but it doesn't work !