Linq. Remove. VS 2008 Final Version

S

shapper

Hello,

I was using LINQ with VS 2008 Beta 2 and suddenly after installed
VS2008 final version I get an error.

My code is really simple:

Dim database As New MyDbDataContext
Dim tag = (From t In database.Tags _
Where t.TagID = index).Single
database.Tags.Remove(tag)
database.SubmitChanges()

I get an error on line 'database.Tags.Remove(tag)':
Remove is not a member of 'System.Data.Linq.Table(Of Tag)

Does anyone has any idea what might be wrong?

Thanks,
Miguel
 
E

Ed Courtenay

shapper said:
Hello,

I was using LINQ with VS 2008 Beta 2 and suddenly after installed
VS2008 final version I get an error.

My code is really simple:

Dim database As New MyDbDataContext
Dim tag = (From t In database.Tags _
Where t.TagID = index).Single
database.Tags.Remove(tag)
database.SubmitChanges()

I get an error on line 'database.Tags.Remove(tag)':


Does anyone has any idea what might be wrong?

Thanks,
Miguel

Change:

database.Tags.Remove(tag)

to:

database.Tags.DeleteOnSubmit(tag)

There were some changes to the LINQ classes in between Beta 2 and Final
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top