Błąd w edytowaniu i usuwaniu z bazy Visual 2008

0

Używam kontrolki DetailsView i LinqDataSource gdy naciskam edit lub delete wyskakuje mi błąd:

Could not find a row that matches the given keys in the original values stored in ViewState.  Ensure that the 'keys' dictionary contains unique key values that correspond to a row returned from the previous Select operation. 

Kiedy edytuję lub usuwam z tabeli :

[Table(Name="dbo.KartyGraficzne")]
public partial class KartyGraficzne : INotifyPropertyChanging, INotifyPropertyChanged
{
	
	private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
	
	private int _Id;
	
	private string _Manufacturer;
	
	private string _Series;
	
	private string _Pipelines;
	
	private string _Core_Speed;
	
	private string _Shader_Speed;
	
	private string _Memory_Speed;
	
	private string _Memory_Bus_Width;
	
	private string _Memory_Type;
	
	private string _Max__Amount_of_Memory;
	
	private string _Transistors;
	
	private string _Technology;
	
	private string _Date_of_Announcement;

Dodam że z insertowaniem nie ma problemów...

0

a properta Id ma ze to promary key i generalnie masz na bazie PK ustawiony?

0

Tak, mam ustawione że Id to primary key, bez tego w ogóle insertować nie mogłem,

Problem już rozwiązany, musiałem do kontrolki DetailsView dodać DataKeyNames="Id"

1 użytkowników online, w tym zalogowanych: 0, gości: 1