You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you add a param in the same call that creates the temp table then the temp table won't be accessible in future calls. This is a very strange behavior we came across today.
This works fine:
connection.Open();
await connection.ExecuteAsync(
@"create table #foo (val int not null);
insert #foo (val) values (123)");
await connection.ExecuteAsync(@"insert #foo (val) values (111)");
var vals = await connection.QueryAsync<int>(@"select * from #foo");
This fails. The error is that the temp table #foo doesn't exist.
connection.Open();
await connection.ExecuteAsync(
@"create table #foo (val int not null);
insert #foo (val) values (@InsertDate)", param: new { InsertDate = insertDate2 });
await connection.ExecuteAsync(@"insert #foo (val) values (111)");
var vals = await connection.QueryAsync<int>(@"select * from #foo");
The text was updated successfully, but these errors were encountered:
Are you 100% the connection was open in the failing case? Not at a PC to try running it (will try to find time this weekend), but : that's the usual explanation for this happening.
If you add a param in the same call that creates the temp table then the temp table won't be accessible in future calls. This is a very strange behavior we came across today.
This works fine:
This fails. The error is that the temp table #foo doesn't exist.
The text was updated successfully, but these errors were encountered: