In SQL Server 2008, we can define a table type and use it as Stored Procedures' parameters. But How can I use it in C# invocation of this SP? In other words, how to create a table or list and pass it into Stored Procedure in C# code with this new feature of SQL Server 2008?
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
The easiest way is by passing a
DataTable
as the parameter. Check out some examples here.From Table-Valued Parameters, linked to in Jeff Meatball Yang's answer:
You need to see this example on CodeProject.
where dt is a DataTable, and the @fileDetails parameter is a table type in SQL:
Edit: This MSDN Developer's Guide article also would help.