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 converti
...@hotmail.com
To: sqlite-users at mailinglists.sqlite.org
Subject: RE: [sqlite] LINQ to SQLite Cannot Update: "Store update, insert, or
delete statement affected an unexpected number of rows"
Date: Sun, 31 May 2015 22:40:56 -0600
Oh. I see what you were trying to say. The error I was having was n
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', an
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:
achkin.com
> To: sqlite-users at mailinglists.sqlite.org
> Date: Sun, 31 May 2015 12:41:24 -0700
> Subject: Re: [sqlite] LINQ to SQLite Cannot Update: "Store update, insert,
> or delete statement affected an unexpected number of rows"
>
>
> Etienne Charland wrote:
&
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 expectatio
ure it can be worked around by replacing Guid with String everywhere in the
code, but there's no reason why it shouldn't be working in the first place.
Etienne
From: mystery...@hotmail.com
To: sqlite-users at mailinglists.sqlite.org
Subject: RE: [sqlite] LINQ to SQLite Cannot Upd
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 experim
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,
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. If
Subject: Re: [sqlite] LINQ to SQLite Cannot Update: "Store update, insert, or
> delete statement affected an unexpected number of rows"
>
> I tried this very basic code on a very basic table that contains no DATETIME
> field.
>
> var Obj = context.MediaCategori
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
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
With System.Data.SQLite and LINQ to Entities, I'm unable to do a simple update.
This code
using (Entities context = new Entities()) {
var Obj = context.MyTable.Where(m =>
m.Title.StartsWith("Alaska")).FirstOrDefault();
Obj.Artist = "A";
context.SaveChanges();
}
T
14 matches
Mail list logo