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?

EthanHunt
  • 473
  • 2
  • 9
  • 19

0 Answers0