KeyboardFriendly
KeyboardFriendly

Reputation: 1798

Linq To Sql Insert For This Statement

Does this insert sql statement have a equivalent using linq to sql or how to write the insert in linq to sql?

INSERT INTO Table(FileId,  FileTitle, Action, FileAsBinary, UploadDate)

Values(NEWID(), 'Hello World Title', 'Upload',(  
SELECT * FROM OPENROWSET(
   BULK 'C:\Files\Docs\TestDoc.docx',
   SINGLE_BLOB) AS x), GetDate())

Upvotes: 0

Views: 96

Answers (1)

Peter Kiss
Peter Kiss

Reputation: 9329

No you have to write a few lines of code to achive this. The Linq to Sql is just a light ORM for MSSQL.

Upvotes: 1

Related Questions