Álvaro García
Álvaro García

Reputation: 19356

c#, System.Data.Sqlite and Ñ character

I am using Sqlite to have a local database. I create the database with the command line tool and the I create the tables with sqlite admin.

I the information of one of the tables I have a register with a "Ñ" characeter. This register is insterted by a sql statement that I execute in sqlite admin.

If i do a select in sqlite admin, I can see that the character "Ñ" is correct, but if I use entity framework and the library System.Data.Sqlite, the string that I receive is "?" or other odd characters (I have tried trying to use UTF8, UTF7, ASCII, UTF32...) but in all the cases I receive odd characters.

I would like to know why I receive this characters if in the database it seems that all is correct. is it possible that the System.Data.Sqlite library has a bug?

Thanks. Daimoroc.

Upvotes: 2

Views: 496

Answers (1)

Álvaro García
Álvaro García

Reputation: 19356

Well, I use sqlite spy, other sqlite administrator, and in this case, the character is shown as "?", so I update the register and in this administrator (sqlite spy) now it is correct.

Then, I execute again my C# application, and now all is correct, so the problem is that sqlite administrator, when I use the sql statement, if the string has this kind of characters, does not work correctly.

So the solution is to find other sqlite adminstrator. For example, sqlite spy, that works fine in this case.

Thanks. Daimroc.

Upvotes: 1

Related Questions