4

I Execute SELECT statement in C# application and russian characters returns as "?" symbol. INSERT statement works correctly.

Code:

SQLiteConnection sql_con = new SQLiteConnection(String.Format("Data Source={0}", local_db));
sql_con.Open();

string query = "SELECT * FROM models";
SQLiteCommand sql_cmd = new SQLiteCommand(query, sql_con);
sql_cmd.ExecuteNonQuery();
SQLiteDataReader reader = sql_cmd.ExecuteReader();

List<Model> all_models = new List<Model>();
while (reader.Read())
{
    Model m = new Model("");
    m.id = Convert.ToInt32(reader["id"]);
    m.name = Convert.ToString(reader["name"]);
    all_models.Add(m);
}

sql_con.Close();

All "name" parametrs in "Model" class is like "???? ????? ??"

Create table statement:

"CREATE TABLE models(id INT, name VARCHAR(100))"

This problem with encoding or something else? How to fix it?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.