How to execute insert query using Entity Framework

.net c# entity-framework sql

Question

I'm attempting to use Entity Framework to run an insert query.

I have something along these lines:

Context.database.ExecuteSqlCommand("Insert into tableName Values({0},{1},{2}", param1, param2, param3)

but this is making a mistake

incorrect syntax near '@p1'

What does "@p1" mean?

1
2
7/10/2015 3:18:05 PM

Popular Answer

ZZZ_tmp
10
8/15/2016 8:01:22 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