Using dapper, why is a temp table created in one use of a connection not available in a second use of the same connection

前端 未结 3 1756
有刺的猬
有刺的猬 2021-01-17 18:32

I\'m trying to perform a series of SQL*Server steps using dapper from C#. One step creates a temp table and populates it. Following steps query data from the temp table.

3条回答
  •  时光说笑
    2021-01-17 19:24

    I suspect the connection is not open. If so, dapper will open and close (back to the pool) the connection as needed. This will reset the connection, losing any temporary tables between commands.

    Just explicitly open the connection.

提交回复
热议问题