ListView and LinqDataSource. Delete item

S

shapper

Hello,

I have a ListView connected to a LinqDataSource. It uses a table,
named Tags, with 2 fields: TagId and Text.

I need to add a column named active. For this I created a
LinqDataSource custom selecting:

Private Sub ldsTags_Selecting(ByVal sender As Object, ByVal e As
LinqDataSourceSelectEventArgs) Handles ldsTags.Selecting
Dim database As New CodeDataContext
Dim tags = From t In database.Tags _
Select t.TagID, _
t.Text, _
Active = t.FilesTags.Any Or
t.ArticlesTags.Any
e.Result = tags
End Sub

As you see I added a new column, Active, create by the relation of
Tags tables and other tables.

Now when I try to delete a record in the ListView it does not work
anymore. I get the following error:

Row not found or changed.

System.Data.Linq.ChangeConflictException: Row not found or changed.

What can I do to fix this?

Thank You,

Miguel
 
S

shapper

Hello,

I have a ListView connected to a LinqDataSource. It uses a table,
named Tags, with 2 fields: TagId and Text.

I need to add a column named active. For this I created a
LinqDataSource custom selecting:

Private Sub ldsTags_Selecting(ByVal sender As Object, ByVal e As
LinqDataSourceSelectEventArgs) Handles ldsTags.Selecting
Dim database As New CodeDataContext
Dim tags = From t In database.Tags _
Select t.TagID, _
t.Text, _
Active = t.FilesTags.Any Or
t.ArticlesTags.Any
e.Result = tags
End Sub

As you see I added a new column, Active, create by the relation of
Tags tables and other tables.

Now when I try to delete a record in the ListView it does not work
anymore. I get the following error:

Row not found or changed.

System.Data.Linq.ChangeConflictException: Row not found or changed.

What can I do to fix this?

Thank You,

Miguel

Please, anyone?

I have been trying to solve this but no success.

Thanks,
Miguel
 

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

Members online

No members online now.

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,710
Latest member
bernietqt

Latest Threads

Top