In C#, I use Dapper to interact with SQL Server. I call a stored procedure that accepts 2 user-defined tables as parameters.
And I am passing a DataTable
to my stored procedure. According to this page, the syntax to pass a DataTable
is like this:
DataTable value = new DataTable();
DynamicParameters allParameters = new DynamicParameters();
allParameters.Add("name", value, value.AsTableValuedParameter("dbo.udt_MyTable"), ParameterDirection.Input, -1);
But I am getting this error:
Argument 3: cannot convert from 'Dapper.SqlMapper.ICustomQueryParameter' to 'System.Data.DbType?'
What is wrong with my syntax? Is the above functionality not working in Dapper?