System.ArgumentException: The table type parameter must have a valid type name

后端 未结 3 566
南方客
南方客 2021-01-01 09:28

I am trying to pass in a user defined table type into a query in C#.

the type is defined with 2 columns (org and sub org)

this is what my code looks like:

3条回答
  •  清酒与你
    2021-01-01 10:01

    Set mapping to your type in SqlServer using TypeName property that: Gets or sets the type name for a table-valued parameter, that has to fix .

    p.TypeName = "dbo.MyType";
    

    Check as well Table-Valued Parameters post

提交回复
热议问题