Hi to all...
How to make an INSERT INTO command in Database.ExecuteSqlCommand in LINQ VB.NET?
I'm getting error/exception like this:
{"An object or column name is missing or empty. For SELECT INTO statements, verify each column has a name. For other statements, look for empty alias names. Aliases defined as "" or [] are not allowed. Change the alias to a valid name."}
Here's my actual code:
db.Database.Connection.ConnectionString = EFManager.GetConnectionString
db.Database.CommandTimeout = DomainConstant.MaximumTimeOut
Dim ProjectID = model.ProjectID, Name = model.Name, FileAttachment = model.FileAttachment, FileSize = model.FileSize, CreatedBy = model.CreatedBy
db.Database.ExecuteSqlCommand(
String.Format(" INSERT INTO [ProjectAttachment] " +
" (ProjectID, Name, FileAttachment, FileSize, CreatedBy) " +
" SELECT {0},{1},{2},{3},{4} " _
, ProjectID, Name, FileAttachment, FileSize, CreatedBy))
End Using
I hope someone could help me on this..
Thank you in advance...