efcore icon indicating copy to clipboard operation
efcore copied to clipboard

Passing Table type or datatable as parameter to stored procedure

Open Manoj-Khatana opened this issue 8 years ago • 3 comments

Hello Guys,

I am trying to pass grid array as data table to sql stored procedure that contains table type parameter. My Source code gets compiled without any issue but when i am trying to run the api. I am getting nothing.

I am converting following array to data table:

[{USERID:'1',VOUCHERNO:'1'},{USERID:'1',VOUCHERNO:'2'},{USERID:'2',VOUCHERNO:'5'},{USERID:'3',VOUCHERNO:'6'}]

Any help will be appreciated

Manoj-Khatana avatar Nov 12 '18 08:11 Manoj-Khatana

https://github.com/aspnet/EntityFrameworkCore/issues/7820

dcarr42 avatar Nov 13 '18 16:11 dcarr42

Pinging @divega

ajcvickers avatar Dec 12 '18 19:12 ajcvickers

@Manoj-Khatana there is the gist at https://gist.github.com/divega/f0f88bf16f35641239cfd9bc534e8d7c which the issue pointed to by @dallancarr references. I haven't tried if that exact code works, but I have been recently playing with table-valued parameters again, so I have a slightly more complex, but up to date example at https://github.com/divega/ContainsOptimization/.

divega avatar Dec 14 '18 23:12 divega