473,769 Members | 7,810 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
Feb 19 '08 #1
1 3913
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
Feb 19 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
9598
by: VR | last post by:
I have a form with a list view control, a button control and a main menu with menuDelete item. Any time I am handling a button click event or menuDelete click event I call DeleteItem() function which removes the selected item from the list. If I right-click on my list, I clone menuDelete item and display a pop-up menu. So, if user selects Delete item in the menu, I go through the same logic and remove the selected item.
7
34793
by: Visual Systems AB \(Martin Arvidsson\) | last post by:
Hi! I'v been struggeling with removing selected items from a listview. Anyone that can give me a piece of code that does this? I am a newbee to this C# and cant figure it out.... Regards Martin Arvidsson
5
2555
by: Bart Steur | last post by:
Hi, What's the best way to programmaticly select (click) another listview Item after removing the selected/focused one. using VB2005 Express. Thanks Bart
0
2136
by: =?Utf-8?B?UmFzbXVz?= | last post by:
I have a simple LiveView control that databinds to a LinqDataSource that maps to a table like this: CREATE TABLE MyTable (Id int NOT NULL, Name nvarchar(50) NULL, Picture image NULL) The OR mapper class (made in the VS 2008 designer) has a property of type System.Data.Linq.Binary
5
9537
by: Mark Olbert | last post by:
How do I get the DataPager and ListView to play nice together when I use a custom datasource? In my webpage, I use linq to pull data from a SqlServer database and assign the resulting IEnumerable<to the ListView's Datasource property. This all works fine to display the first 3 items (the DataPager is set to display three items at a time), but when I click on the next page in the DataPager...nothing happens. There's a roundtrip to the...
0
911
by: shapper | last post by:
Hello, I created a ListView at runtime by implementing the ITemplate. Inside my Edit Item template I have custom control, named MyForm, that contains two buttons: "Update" and "Cancel" When one of the buttons is clicked a Command event of MyForm is fired. Inside this event I can detected which button was clicked.
0
2867
by: Marius Manolea | last post by:
Hi, I have a strange problem, I don't receive any modifications from listview in edit mode (OldValues & NewValues are empty) <asp:ListView ID="lvEditPersonRoles" runat="server" DataKeyNames="PersonId,RoleEntityGroup" DataSourceID="LDSPersonRoles"
2
3364
by: =?Utf-8?B?UGhpbGlw?= | last post by:
I am attempting to insert a simple record with LinqDataSource from a ListView, however I always get a message saying "....LinqDataSource 'dataSource' has no values to insert. Check that the 'values' dictionary contains values...." I am using a ListView with a DataSourceID of a LinqDataSource. When a new row icon is clicked....the ListView properly enters into the InsertItemTemplate....however when the ImageButton with a CommandName of...
0
1595
by: Andy B | last post by:
I have a GridView with a LINQDataSource attached to it. My code in the aspx markup is below. I need to know why only the checkbox field for the activated column is getting updated (the EditTemplate). None of the other columns get updated except for that one. Any ideas? The only column that is not able to be updated is the ID column, but that isn't even in the table. <asp:GridView ID="EternityNewsMemberList" runat="server"...
0
10049
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9998
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9865
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8876
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7413
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5310
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3967
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3567
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.