LINQ insert method problem, .NET 3.5, VS2008, LINQ

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Dec 2007
Posts: 3
Reputation: andrewgxx is an unknown quantity at this point 
Solved Threads: 0
andrewgxx andrewgxx is offline Offline
Newbie Poster

LINQ insert method problem, .NET 3.5, VS2008, LINQ

 
0
  #1
Aug 22nd, 2008
Overview
I have a form that the user fills in.
A event to my C# codebehind page fires on the save button click.
The btnSave_Click method load up the 3 LINQ Entities with the correct values.
I call the LINQ method "InsertProject" to insert the data into the SQL tables.

The error message I am getting is "The type arguments for method BLAH cannot be inferred from the usage. Try specifying the type arguments explicity.

This is my method

public static Project InsertProject(Security securityAccess, Proj project, Property property)
{
DevDataContext db = new DevDataContext();
db.Security.InsertOnSubmit(securityAccess);
db.SubmitChanges();

project.ControlID = securityAccess.ControlID;
db.Proj.InsertOnSubmit(project);
db.SubmitChanges();

projectProperty.ProjectID = project.ProjectID;
db.Property.InsertAllOnSubmit(projectProperty); <=== ERROR HERE

db.SubmitChanges();
return project;
}
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 3
Reputation: andrewgxx is an unknown quantity at this point 
Solved Threads: 0
andrewgxx andrewgxx is offline Offline
Newbie Poster

Re: LINQ insert method problem, .NET 3.5, VS2008, LINQ

 
0
  #2
Aug 22nd, 2008
Answer found! I am using InsertAllOnSubmit should use InsertOnSubmit
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC