[sqlite] LINQ to SQLite Cannot Update: "Store update, insert, or delete statement affected an unexpected number of rows"

2015-06-01 Thread Etienne Charland
Ok. Setting BinaryGUID=False in the connection does work. However, there are weveral bugs. 1. In the Server Explorer, if you edit advanced settings to set Binary Guid to False, it will generate "binary guid=False" instead of "BinaryGUID=False" 2. When generating LINQ Select queries and

[sqlite] LINQ to SQLite Cannot Update: "Store update, insert, or delete statement affected an unexpected number of rows"

2015-06-01 Thread Etienne Charland
I did some more tests. The way it handles GUID between text and binary is screwed up. When updating data, it will update as binary even if BinaryGUID is false. When selecting data, however, it tries to select it as plain text so nothing matches the query. Etienne From:

[sqlite] LINQ to SQLite Cannot Update: "Store update, insert, or delete statement affected an unexpected number of rows"

2015-05-31 Thread Etienne Charland
Oh. I see what you were trying to say. The error I was having was not because GUID isn't supported, but because it was trying to interpret the data as binary while it was stored as text, thus the request failed. I just tried creating a new table with a primary key of type 'uniqueidentifier',

[sqlite] LINQ to SQLite Cannot Update: "Store update, insert, or delete statement affected an unexpected number of rows"

2015-05-31 Thread Joe Mistachkin
Etienne Charland wrote: > > I just tried creating a new table with a primary key of type > 'uniqueidentifier', and adding data into it. It shows up as > binary data. > This is also controlled by the "BinaryGUID" (no spaces) connection string property. Here is an example connection string:

[sqlite] LINQ to SQLite Cannot Update: "Store update, insert, or delete statement affected an unexpected number of rows"

2015-05-31 Thread Etienne Charland
The point I'm trying to make is not about whether GUID gets stored as binary or text... but rather that currently it's not working at all. There's no reason why GUIDs shouldn't be supported and should crash when trying to do an update. Etienne > From: sqlite at mistachkin.com > To:

[sqlite] LINQ to SQLite Cannot Update: "Store update, insert, or delete statement affected an unexpected number of rows"

2015-05-31 Thread Joe Mistachkin
Etienne Charland wrote: > > The point I'm trying to make is not about whether GUID gets stored as > binary or text... > First, the exception being thrown here originates from deep within the .NET Framework itself and indicates that the number of rows impacted by the query did not match

[sqlite] LINQ to SQLite Cannot Update: "Store update, insert, or delete statement affected an unexpected number of rows"

2015-05-31 Thread Etienne Charland
SQLite doesn't have support for many data types, but in fact it just doesn't have many restrictions. It doesn't have data types but affinities. When defining a column as "uniqueidentifier" in SQLite, it still stores the data as text. It would be the .NET provider's job to convert it back and

[sqlite] LINQ to SQLite Cannot Update: "Store update, insert, or delete statement affected an unexpected number of rows"

2015-05-31 Thread Joe Mistachkin
Etienne Charland wrote: > > When defining a column as "uniqueidentifier" in SQLite, it still stores the > data as text. It would be the .NET provider's job to convert it back and > forth to Guid. > This depends on the value of the BinaryGUID connection string property. You might want to

[sqlite] LINQ to SQLite Cannot Update: "Store update, insert, or delete statement affected an unexpected number of rows"

2015-05-30 Thread Etienne Charland
Thanks! If I change the column type from UNIQUEIDENTIFIER to TEXT, it works. Only thing is, the code then maps to String instead of Guid. Is there any way to keep the .NET code working with Guid classes? I'm also seeing that BIT data type isn't supported and should be replaced by INT. However,

[sqlite] LINQ to SQLite Cannot Update: "Store update, insert, or delete statement affected an unexpected number of rows"

2015-05-30 Thread Simon Slavin
On 30 May 2015, at 4:48am, Etienne Charland wrote: > I think I found where the problem is coming from. I did an automated database > conversion from SQL Server. Most primary keys are GUIDs. In SQLite, these > columns are still defined as 'uniqueidentifier' which is not a valid data > type.

[sqlite] LINQ to SQLite Cannot Update: "Store update, insert, or delete statement affected an unexpected number of rows"

2015-05-29 Thread Etienne Charland
I think I found where the problem is coming from. I did an automated database conversion from SQL Server. Most primary keys are GUIDs. In SQLite, these columns are still defined as 'uniqueidentifier' which is not a valid data type. If I try updating a table that has INT primary key, then it

[sqlite] LINQ to SQLite Cannot Update: "Store update, insert, or delete statement affected an unexpected number of rows"

2015-05-29 Thread Etienne Charland
I tried this very basic code on a very basic table that contains no DATETIME field. var Obj = context.MediaCategories.FirstOrDefault(); Obj.Folder = "test"; context.SaveChanges(); The table has this format - MediaCategoryId GUID Primary Key - MediaTypeId INT - Name NVARCHAR - Folder NVARCHAR I

[sqlite] LINQ to SQLite Cannot Update: "Store update, insert, or delete statement affected an unexpected number of rows"

2015-05-29 Thread Joe Mistachkin
Your issue might be related to this: https://system.data.sqlite.org/index.html/tktview/4bbf851fa5b26c1ca74a However, it's difficult to determine without seeing the database and the SQL generated from the LINQ code. -- Joe Mistachkin