This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
I created a simple User Defined Table Type in SQL 2008 as follows:
So that I can pass a string array to my stored procedure. I need help on creating a Lightspeed mapping and using the created Lightspeed type to invoke my stored procedure. I have browsed through the manual which was helpful in guiding me create the ProcedureQuery and ProcedureParameters. However, I need more clarity on how exactly one uses a UDTT as I get the following exception with current code:
No mapping exists from object type System.String[] to a known managed provider native type. TIA. |
|
|
Guys, this is show stopping for me. Any advice on what to do? I tried
and got same exception. |
|
|
Your FindBySql code is almost right, but you need to pass a proper structured data type rather than just an array of strings. Here's how to do that:
Note that this is not a LightSpeed issue -- this is just how SQL Server table type parameters work in ADO.NET. For your convenience, we've added an enhancement to our SQL 2008 provider so that you can pass a collection of SqlDataRecords via a ProcedureParameter and it will work automatically:
This enhancement will be included in the next nightly build, available from about 1200 GMT. The FindBySql technique should work in current builds with the change outlined above. Let us know if you still run into problems! |
|
|
Ivan, you are the man. Thanks again. |
|
|
Ivan, you are the man. Thanks again. |
|
|
Ivan, I realize this may not be a LightSpeed issue but why I really could use some help here: Why would I be getting the following exception when executing the query through FindBySql?
Even though I created and added this SqlParameter to the command's Parameters collection? Thanks again. |
|
|
Figured out that CommandText and parameters had to be modified as follows:
|
|
|
The problem is that you are setting a CommandText Change the CommandText to No, I don't know why this makes a difference...! |
|