ErikEJ / SqlCeToolbox

SQLite & SQL Server Compact Toolbox extension for Visual Studio, SSMS (and stand alone)
Other
846 stars 174 forks source link

Unable to edit values in table #440

Closed PatrickRyder closed 7 years ago

PatrickRyder commented 7 years ago

Describe what is not working as expected. If I choose the option to edit the top 200 rows of a table, I can edit a value, TAB (or RETURN) away from it, but when I save then refresh I get the old value back.

The problem also happens if I save the table then close it and re-open it.

Steps to reproduce

  1. Right-click any table and select 'Edit top 200 rows'.
  2. Select any value on the grid, or any type.
  3. Use either TAB or RETURN to move off the box.
  4. Save the table.
  5. Refresh the table.
  6. The old value comes back.

Further technical details

This is Visual Studio 2015 Community 14.0.25431.01 Update 3. Toolbox version is 4.7.234.0. Database engine: SQlite

ErikEJ commented 7 years ago

And if you use arrow up or arrow down?

PatrickRyder commented 7 years ago

Hi, Erik,

If I use the arrows, I get a red exclamation mark in the margin. Hovering over it, it says 'Concurrency Violation: The UpdateCommand affected 0 of the expected 1 rows'.

This happens regardless of whether I am debugging my project or not.

Kind wishes - Patrick Ryder

Author of 'Spiders in Your Mind', a collection of new short stories for those of you who like a scare and 'Crossed Shadows', a novel unlike any you will have read before. A bold claim, I know. 'Crossed Shadows' available at Amazon: http://goo.gl/48d7LD.http://goo.gl/48d7LD Crossed Shadows eBook: Patrick Ryder: Amazon.co.uk: Kindle Store Crossed Shadows eBook: Patrick Ryder: Amazon.co.uk: Kindle Store Read more...http://goo.gl/48d7LD

Remove preview 'Spiders in Your Mind' available at Amazon: http://www.amazon.co.uk/Patrick-Ryder/e/B00ANLOWR8/ref=ntt_athr_dp_pel_pop_1. All other e-reader formats??available (e.g. Nook) at Smashwords: http://www.smashwords.com/profile/view/PatrickRyder Also available in Apple iStore and Barnes & Noble. My work is free for members of the armed forces. I also have some free copies to give away. Please drop me a line if you would like one. I'd love to hear from you anyway.


From: Erik Ejlskov Jensen notifications@github.com Sent: 23 August 2017 09:40:43 To: ErikEJ/SqlCeToolbox Cc: PatrickRyder; Author Subject: Re: [ErikEJ/SqlCeToolbox] Unable to edit values in table (#440)

And if you use arrow up or arrow down?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/ErikEJ/SqlCeToolbox/issues/440#issuecomment-324262257, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AM5lM2CsdmuM5Mk8NvljJJ6SPc8AqqNSks5sa-WLgaJpZM4O_rUr.

ErikEJ commented 7 years ago

Does your table have a primary key?

ErikEJ commented 7 years ago

Or can you share your db with me (privately, perhaps) ?

PatrickRyder commented 7 years ago

It's just test data, nothing sensitive, so I have attached it.

Kind wishes - Patrick Ryder

Author of 'Spiders in Your Mind', a collection of new short stories for those of you who like a scare and 'Crossed Shadows', a novel unlike any you will have read before. A bold claim, I know. 'Crossed Shadows' available at Amazon: http://goo.gl/48d7LD.http://goo.gl/48d7LD Crossed Shadows eBook: Patrick Ryder: Amazon.co.uk: Kindle Store Crossed Shadows eBook: Patrick Ryder: Amazon.co.uk: Kindle Store Read more...http://goo.gl/48d7LD

Remove preview 'Spiders in Your Mind' available at Amazon: http://www.amazon.co.uk/Patrick-Ryder/e/B00ANLOWR8/ref=ntt_athr_dp_pel_pop_1. All other e-reader formats??available (e.g. Nook) at Smashwords: http://www.smashwords.com/profile/view/PatrickRyder Also available in Apple iStore and Barnes & Noble. My work is free for members of the armed forces. I also have some free copies to give away. Please drop me a line if you would like one. I'd love to hear from you anyway.


From: Erik Ejlskov Jensen notifications@github.com Sent: 23 August 2017 10:02:48 To: ErikEJ/SqlCeToolbox Cc: PatrickRyder; Author Subject: Re: [ErikEJ/SqlCeToolbox] Unable to edit values in table (#440)

Or can you share your db with me (privately, perhaps) ?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/ErikEJ/SqlCeToolbox/issues/440#issuecomment-324267897, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AM5lM_tEDFEnzez_ruIjyKiEiceR1Xlmks5sa-q4gaJpZM4O_rUr.

PatrickRyder commented 7 years ago

Hi, Erik,

This is part of the table definition:

CREATETABLE IF NOT EXISTS Users ( PK_id INTEGER PRIMARY KEY AUTOINCREMENT, username TEXT UNIQUE NOT NULL, first_name TEXT, last_name TEXT, display_name TEXT,

Kind wishes - Patrick Ryder

Author of 'Spiders in Your Mind', a collection of new short stories for those of you who like a scare and 'Crossed Shadows', a novel unlike any you will have read before. A bold claim, I know. 'Crossed Shadows' available at Amazon: http://goo.gl/48d7LD.http://goo.gl/48d7LD Crossed Shadows eBook: Patrick Ryder: Amazon.co.uk: Kindle Store Crossed Shadows eBook: Patrick Ryder: Amazon.co.uk: Kindle Store Read more...http://goo.gl/48d7LD

Remove preview 'Spiders in Your Mind' available at Amazon: http://www.amazon.co.uk/Patrick-Ryder/e/B00ANLOWR8/ref=ntt_athr_dp_pel_pop_1. All other e-reader formats??available (e.g. Nook) at Smashwords: http://www.smashwords.com/profile/view/PatrickRyder Also available in Apple iStore and Barnes & Noble. My work is free for members of the armed forces. I also have some free copies to give away. Please drop me a line if you would like one. I'd love to hear from you anyway.


From: Erik Ejlskov Jensen notifications@github.com Sent: 23 August 2017 10:02:29 To: ErikEJ/SqlCeToolbox Cc: PatrickRyder; Author Subject: Re: [ErikEJ/SqlCeToolbox] Unable to edit values in table (#440)

Does your table have a primary key?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/ErikEJ/SqlCeToolbox/issues/440#issuecomment-324267816, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AM5lM8lhFjMwLvjsk88nBpkJd3JY35fKks5sa-qkgaJpZM4O_rUr.

ErikEJ commented 7 years ago

To share the database, you must upload on Github - TIA

PatrickRyder commented 7 years ago

Here it is (I hope): DB21.zip

ErikEJ commented 7 years ago

I have looked at your db, there is something special about this table that prevents updates, wonder if it is the unique constraint on UserName? Other tables are editable... !?

ErikEJ commented 7 years ago

It looks like it is this unique constraint that is preventing the save from happening:

username TEXT UNIQUE NOT NULL,

Not sure how to work around it, but I will investigate improving a visual idnication that the save failed, so I does not fail "silently"

ErikEJ commented 7 years ago

https://stackoverflow.com/questions/31750507/forcing-errortext-to-show-in-a-datagridview

https://stackoverflow.com/questions/291475/datagridview-not-displaying-the-error-icon-or-error-text

PatrickRyder commented 7 years ago

Okay, Erik. Thanks for looking. I did wonder if it might be that, but I was in the middle of my own mini-nightmare so didn't investigate further.

Maybe I will remove the constraint and simply ensure this is checked in my code.

Kind wishes - Patrick Ryder

Author of 'Spiders in Your Mind', a collection of new short stories for those of you who like a scare and 'Crossed Shadows', a novel unlike any you will have read before. A bold claim, I know. 'Crossed Shadows' available at Amazon: http://goo.gl/48d7LD.http://goo.gl/48d7LD Crossed Shadows eBook: Patrick Ryder: Amazon.co.uk: Kindle Store Crossed Shadows eBook: Patrick Ryder: Amazon.co.uk: Kindle Store Read more...http://goo.gl/48d7LD

Remove preview 'Spiders in Your Mind' available at Amazon: http://www.amazon.co.uk/Patrick-Ryder/e/B00ANLOWR8/ref=ntt_athr_dp_pel_pop_1. All other e-reader formats??available (e.g. Nook) at Smashwords: http://www.smashwords.com/profile/view/PatrickRyder Also available in Apple iStore and Barnes & Noble. My work is free for members of the armed forces. I also have some free copies to give away. Please drop me a line if you would like one. I'd love to hear from you anyway.


From: Erik Ejlskov Jensen notifications@github.com Sent: 25 August 2017 14:44:47 To: ErikEJ/SqlCeToolbox Cc: PatrickRyder; Author Subject: Re: [ErikEJ/SqlCeToolbox] Unable to edit values in table (#440)

https://stackoverflow.com/questions/31750507/forcing-errortext-to-show-in-a-datagridview

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/ErikEJ/SqlCeToolbox/issues/440#issuecomment-324924384, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AM5lM9jSn5LQX7aGLnlZtrFmBPjbY46gks5sbs_OgaJpZM4O_rUr.