jonwagner / Insight.Database

Fast, lightweight .NET micro-ORM
Other
861 stars 145 forks source link

Pass datatable as SqlParameter #358

Closed yrepillez closed 6 years ago

yrepillez commented 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:

Can Anyone help me?

jonwagner commented 6 years ago

It sounds like you're looking for this wiki page:

https://github.com/jonwagner/Insight.Database/wiki/Lists-of-Objects-as-Parameters

jonwagner commented 6 years ago

I'm assuming that the wiki page had enough information to help you.