On Tue, Apr 13, 2010 at 1:19 PM, comicrage <[email protected]> wrote:
> Hi,
>
> I just wrote my first LINQ to SQL C# code and encounter an error when
> performing an ADD and SELECT call. I written a sliver to WCF to SQL
> Server code. I created the DataClasses.dbml code with the designer
> instead of SQL Metal. In the WCF cocde, The ADD method
>
> DataClassesDataContext db = new DataClassesDataContext();
>
> Table<Log> LogTable = db.GetTable<Log>();
>
> LogTable.InsertOnSubmit(Log);
>
> LogTable.Context.SubmitChanges();
>
----------
I see confusion between what you are working with here.
Your table myTable, your collection of data myCol
List<Log> log = (from lo in db.MyTable
select lo).toList()
Add more data into log now come back to Linq.
foreach(Log lo in log)
{
if(NewFlagForInsert)
{
db.AddToMyTable(lo);
}
}
db.SaveChanges();
--
Stephen Russell
Sr. Production Systems Programmer
CIMSgts
901.246-0159 cell
--
To unsubscribe, reply using "remove me" as the subject.