rileyrenn6 / dapper-dot-net

Automatically exported from code.google.com/p/dapper-dot-net
0 stars 0 forks source link

Passing a DataTable parameter to a Stored procedure #176

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I have had some progress with sending Table Valued Parameters to a stored 
procedure using Dapper I used the modified Mapper.cs file here - 

http://code.google.com/p/dapper-dot-net/issues/detail?id=117

My code works just fine. My question is -

1) If the official Dapper file will incorporate a change like this to support 
Table Valued Parameters

2) How often does Dapper change/evolve to incorporate new SQL Server features. 
I understand it being Open source I will get solutions to incorporate the 
changes myself. But does the community leadership target a particular timeframe 
to accomodate new changes in the official Dapper file?

Original issue reported on code.google.com by hskarach...@gmail.com on 2 Jun 2014 at 10:38

GoogleCodeExporter commented 8 years ago
This is not exactly a "new" database feature in terms of dapper. When we looked 
at this first, there were some issues in terms of metadata, in particular 
specifying the table-type, but it is perhaps long overdue time to revisit this.

Original comment by marc.gravell on 2 Jun 2014 at 11:31

GoogleCodeExporter commented 8 years ago
Hey marc.gravell,

So can we look forward to Dapper source changing to accomodate TVP?

Original comment by hskarach...@gmail.com on 2 Jun 2014 at 12:23

GoogleCodeExporter commented 8 years ago
I've pushed code (not NuGet) with a .AsTableValuedParameter() extension method 
on data-tables; this is necessary to allow the same level of support for both 
command-text and sproc code, since a type-name is required for command-text. 
Thoughts?

Original comment by marc.gravell on 2 Jun 2014 at 1:20

GoogleCodeExporter commented 8 years ago
I'm really sorry I am not well versed with the code in SqlMapper. Is this 
similar to the change in the file attached? If so it works perfectly fine her.

Also I would need a NuGet release to justify use in production got a few haters 
here :(

Original comment by hskarach...@gmail.com on 2 Jun 2014 at 1:29

Attachments:

GoogleCodeExporter commented 8 years ago
I'm guessing you're using stored procedures, right? As far as I can see, it 
**cannot** work fine, except for stored procedures.

Original comment by marc.gravell on 2 Jun 2014 at 1:38

GoogleCodeExporter commented 8 years ago
Oh yes I havent mentioned that?
I'm so sorry...I am doing an insert using a stored procedure...which needs a 
TVP...which I pass using a data table. This functionality works using the file 
I attached. I was however hoping that the official NuGet dll also gets a change.

Original comment by hskarach...@gmail.com on 3 Jun 2014 at 7:48

GoogleCodeExporter commented 8 years ago
indeed. I'm happy to look further at making it work more easily for sprocs (the 
change is actually to do less, and is not huge) - but if we have inbuilt TVP 
support I want it to work for command-text too. About to fly to NDC Oslo. Will 
look again upon return.

Original comment by marc.gravell on 3 Jun 2014 at 8:38

GoogleCodeExporter commented 8 years ago
Thats great. Thank you so much.

Original comment by hskarach...@gmail.com on 3 Jun 2014 at 8:46

GoogleCodeExporter commented 8 years ago
Hi Marc,

I was wondering if there has been any progress in integrating TVP support in 
Dapper. A follow up to this conversation we had.

Original comment by hskarach...@gmail.com on 10 Jul 2014 at 11:13

GoogleCodeExporter commented 8 years ago
Yes; lots. http://stackoverflow.com/a/24633764/23354

That do? I'm going to mark this complete.

Original comment by marc.gravell on 10 Jul 2014 at 11:35

GoogleCodeExporter commented 8 years ago
oh thats great! Is the updated dll available on NuGet? Or should I pull from 
GitHub?

Original comment by hskarach...@gmail.com on 10 Jul 2014 at 12:02

GoogleCodeExporter commented 8 years ago
Yes, that build is (I'm 99.99% sure) available on NuGet; see also:

http://blog.marcgravell.com/2014/07/dapper-gets-type-handlers-and-learns.html
http://blog.marcgravell.com/2014/06/dapper-some-minor-but-useful-tweaks.html

Original comment by marc.gravell on 10 Jul 2014 at 12:04

GoogleCodeExporter commented 8 years ago
Great! Thanks a lot Marc. Dapper is truly amazing thanks to you guys

Original comment by hskarach...@gmail.com on 10 Jul 2014 at 12:15