How to use temporary table in EF6

c# entity-framework entity-framework-6

Question

I must read data from an excel file, save it in a temporary table (the device's temp table), then copy all of the data into this table once it has been read. Previous entries must be deleted because these records are updated in the actual table (userDevices).

In my project, EF6 was used. therefore I mapped entity "Device" to the table "userDevices". How will I use the entity framework to add data to a temporary database and subsequently replace it in the real table?

Is stored proc the only choice available? Or is EF available for the same purpose?

1
3
3/29/2015 5:34:39 PM

Accepted Answer

The only method to use temporary tables is to create, modify, insert, and finally remove data from them using stored procedures. Once those are configured,EF can contact them and use them.

In passingEF does not look throughtempDb Any temp table, regardless of session, can be created using the schema when the table mappings are created.# vs ## ) status cannot be utilized because of the way temporary tables work.

7
9/12/2016 10:52:56 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow