我试图将字符串列表作为参数传递到存储过程,该过程期望具有单列的表的UDT。我正在与SqlCommand对象错误,我发现那个帖子说使用数据表:将IEnumerable <string>作为用户定义的表类型参数传递给SQL Server存储过程
How to pass User Defined Table Type as Stored Procedured parameter in C#
我想知道是否有考虑到我没有多列一个简单的方法。在该过程中,我正在将表类型作为子选择与其他表进行操作,因此保留此功能将很不错。
有没有更好的方法,或者只是转换为DataTable?
谢谢!
参见[目前公认的答案(http://stackoverflow.com/a/1253737/173497)现有问题[C# - 转换IEnumerable的数据表来(http://stackoverflow.com/questions/1253725/convert-ienumerable-to-datatable),您可以使用它将一个'IEnumerable'转换为'DataTable'。 –