Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ListView and LinqDataSource. Delete item

Reply
Thread Tools

ListView and LinqDataSource. Delete item

 
 
shapper
Guest
Posts: n/a
 
      02-19-2008
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
 
Reply With Quote
 
 
 
 
shapper
Guest
Posts: n/a
 
      02-19-2008
On Feb 19, 2:26 am, shapper <(E-Mail Removed)> 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
asp.net ListView control - Configure ListView option missing? . ASP .Net 0 07-24-2010 12:20 AM
Re: limit listview designtime item count germ ASP .Net 0 02-04-2010 06:01 PM
ListView Selected Item Not Working Mike Collins ASP .Net 0 08-12-2008 06:03 PM
properly delete item during "for item in..." Ratko Python 7 07-17-2008 07:56 PM
Help! acts_as_nested_set Administration (add new item, delete item) Namor Ruby 0 01-19-2006 08:26 AM



Advertisments