JocaPC / Belgrade-SqlClient

Small async ADO.NET helper library
http://jocapc.github.io/Belgrade-SqlClient/
Other
93 stars 13 forks source link

Pass User-Defined Table Types as parameter to Stored Procedure #12

Open WJChai opened 4 years ago

WJChai commented 4 years ago

Hi, is it possible to pass User-Defined Table Types in await sqlCmd .Proc("SomeStoreProcedure") .Param("aUserDefinedTypeParam", aSqlParameterInstance)? Thanks

WJChai commented 4 years ago

I try to merge it with classic SqlCommand way of adding parameters and it works:- ` var command = new SqlCommand("EXEC SomeStoredProcedure @intParam=@intParam, @tblParam=@tblParam");

command.Parameters.Add(tblParamSqlParameterInstance);

await this._command.Sql(command) .Param("intParam", 3) `

Is this the recommended way?