entity framework - C# EF how to execute standard SQL command? -


is there way execute sqlcommand in ef? mean, can create entitycommand, msdn says insert,delete,update not supported in those.

the reason want work raw sqlcommand because have table stores big files (around 1 gb) in it's rows, , want read/write rows in stream-like manner:

var con = ((iobjectcontextadapter)ctx).objectcontext.connection entityconnection;  //for header of stream var cmdinsert = con.createcommand(); cmdinsert.commandtext = @"insert [dbo].[blobtable] values (@data)"; cmdinsert.parameters.add("data", dbtype.binary, -1);  //for body of stream var cmdupdate = con.createcommand(); cmdupdate.commandtext = @"update [dbo].[blobtable] set content.write (@data) id = @id"; cmdupdate.parameters.add("data", dbtype.binary, -1); cmdupdate.parameters.add("id", dbtype.int64, -1); 

but ef:

the query syntax not valid. near identifier 'into', line 1, column 8.

ps: filestream not option. spend time figure out how run "simple" example of how use no success.


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -