Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

European characters garbled when inserted using SQLite for .NET

Posted on 2011-02-25
2
Medium Priority
?
517 Views
Last Modified: 2012-05-11
I have a problem where foreign characters get messed up when I write them to the database from .NET. Sample code made as simple as possible:

Dim cnn As New System.Data.SQLite.SQLiteConnection("test.db;UseUTF16Encoding=true")
cnn.Open()
Dim cmd As New System.Data.SQLite.SQLiteCommand("INSERT INTO test (test) VALUES ('Àlex')", cnn)
cmd.ExecuteNonQuery()

Result:

When I look at the table in SQLite Administrator, the field value shows as "Àlex". When I run the exact same query directly in SQLite Administratr, the field value shows correctly. What am I doing wrong?
0
Comment
Question by:wwarby
2 Comments
 
LVL 23

Accepted Solution

by:
wdosanjos earned 2000 total points
ID: 34982078
I think SQLite Administrator uses a different char encoding than your program.  Is there a setting where you can change that?

When you retrieve the value on .NET, does it show correctly?
0
 
LVL 1

Author Comment

by:wwarby
ID: 34982177
wdosanjos: Idiotically, I hadn't even thought to try reading the data back in .NET since I could see it was wrong in SQLite Administrator, but you're absolutely right - it comes out exactly as it went in in .NET - it just looks wrong in the SQLite Administrator which makes the problem more of an annoyance than a crippling obstacle. There seems to be no way to change the display in SQLite Administrator but I can live with it. Thanks!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I’ll look at how you can use a backup to start a secondary instance for MongoDB.
Creating a Cordova application which allow user to save to/load from his Dropbox account the application database.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Suggested Courses

877 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question