0

How can I send "List" to SP in .NET? I used loop util now, but it has low performance beacuse of overfull I/O Connection. So, I think that Sending "List" to DB Server is solution.

(Under code is Sample)

ISession session = ....;
Foreach(ProductDto PD in insertList)
{
  IQuery query = session.CreateSQLQuery("exec Log @A=:a, @B=:b");
  query.SetDateTime("A", ProductDto.a);
  query.SetString("B", ProductDto.b);
  query.ExecuteUpdate();
}
Edzer Pebesma
  • 3,814
  • 16
  • 26
임연규
  • 21
  • 1
  • 3
  • You can pass a table into the SP Take a look at this, see if it helps: http://www.mssqltips.com/sqlservertip/2112/table-value-parameters-in-sql-server-2008-and-net-c/ – User2012384 Mar 19 '15 at 01:09

1 Answers1

0

Calling of stored procedure and passing it a list as input is answered here: Passing List<> to SQL Stored Procedure

Community
  • 1
  • 1
webcodervk
  • 145
  • 8