ListView and LinqDataSource. Delete item

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • shapper

    ListView and LinqDataSource. Delete item

    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_Selecti ng(ByVal sender As Object, ByVal e As
    LinqDataSourceS electEventArgs) Handles ldsTags.Selecti ng
    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.Lin q.ChangeConflic tException: Row not found or changed.

    What can I do to fix this?

    Thank You,

    Miguel
  • shapper

    #2
    Re: ListView and LinqDataSource. Delete item

    On Feb 19, 2:26 am, shapper <mdmo...@gmail. comwrote:
    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_Selecti ng(ByVal sender As Object, ByVal e As
    LinqDataSourceS electEventArgs) Handles ldsTags.Selecti ng
    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.Lin q.ChangeConflic tException: 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

    Comment

    Working...