-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Closed
Description
We find out an issue from stored procedure with DynamicParameters.Get("@outstring"). it always error exception converting data type nvarchar(max) to int.
stored procedure code:
ALTER PROC [dbo].[usp_Test]
@RESULT INT OUT,
@OUTSTRING NVARCHAR(MAX) OUT
AS
SET @RESULT=1
SET @OUTSTRING = 'HELLO WORLD!!'c# code:
var dparams = new DynamicParameters();
dparams.Add("@RESULT", DbType.Int32, direction: ParameterDirection.Output);
dparams.Add("@OUTSTRING", DbType.String, direction: ParameterDirection.Output);
int row = conn.Execute("usp_Test", dparams, commandType:CommandType.StoredProcedure);
result = new Result() {
RESULT = dparams.Get<int>("@RESULT"),
OUTSTRING = dparams.Get<string>("@OUTSTRING") // here
};Metadata
Metadata
Assignees
Labels
No labels