Closed yrepillez closed 6 years ago
Hi,
I'm looking for a solution for sending a datable (varcharlist) as SqlParameter in a SQL Server Query. Here is my query:
database.Query("MyProc", new { Param1= stringParam, Param2 = dataTable }, Query.Returns<MyObject>(), commandTimeout: 0);
Previously I send it like this:
DataTable dataTable
SqlParameter list = new SqlParameter { ParameterName = "@List", Value = dataTable, TypeName = "VarcharList", SqlDbType = SqlDbType.Structured };
Can Anyone help me?
It sounds like you're looking for this wiki page:
https://github.com/jonwagner/Insight.Database/wiki/Lists-of-Objects-as-Parameters
I'm assuming that the wiki page had enough information to help you.
Hi,
I'm looking for a solution for sending a datable (varcharlist) as SqlParameter in a SQL Server Query. Here is my query:
database.Query("MyProc", new { Param1= stringParam, Param2 = dataTable }, Query.Returns<MyObject>(), commandTimeout: 0);
Previously I send it like this:
DataTable dataTable
SqlParameter list = new SqlParameter { ParameterName = "@List", Value = dataTable, TypeName = "VarcharList", SqlDbType = SqlDbType.Structured };
Can Anyone help me?