ListView and LinqDataSource. Delete item

Discussion in 'ASP .Net' started by shapper, Feb 19, 2008.

  1. shapper

    shapper Guest

    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
     
    shapper, Feb 19, 2008
    #1
    1. Advertising

  2. shapper

    shapper Guest

    On Feb 19, 2:26 am, shapper <> wrote:
    > 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
     
    shapper, Feb 19, 2008
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rasmus
    Replies:
    0
    Views:
    481
    Rasmus
    Dec 12, 2007
  2. Marius Manolea
    Replies:
    0
    Views:
    1,081
    Marius Manolea
    Jun 4, 2008
  3. Ratko
    Replies:
    7
    Views:
    302
    Reedick, Andrew
    Jul 17, 2008
  4. Philip
    Replies:
    2
    Views:
    743
    Philip
    Jul 23, 2008
  5. .
    Replies:
    0
    Views:
    794
Loading...

Share This Page