Question

How, if at all, can I pass in a table-valued parameter into a query when using Mono? (I'm currently using version 2.10.12)

It seems that the SqlDbType enumeration in Mono has not been extended to match Microsoft's implementation of the enumeration, nor has the SqlParameter class been updated to include the TypeName property.

Background on me and my question:

  • I am very familiar with table-valued parameters
  • I have Googled this extensively
  • I've tried reaching out to others in the #mono channel at irc.gnome.org

Any help on this question is greatly appreciated!

Was it helpful?

Solution

I am trying to do the same thing. In our case, setting TypeName was not required to get the query to work on MS .Net, which got rid of that Mono error.

Now I get the following error:

System.ArgumentOutOfRangeException: No mapping exists from SqlDbType Structured to a known DbType

I decompiled System.Data.dll from the Mono 3.0 libraries and the map it creates does not contain a mapping for SqlDbType.Structured. The enumeration for SqlDbType in the Mono library does have Structured enumerated.

From what I can tell, Mono does not support passing in UDT/table value parameters to sql queries. We are still looking into ways to get around this, but I don't hold out much hope. Searching the web for UDT and mono returns almost no results.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top