我试图从Condition本地sqlite数据库中的表中读取所有数据.但是我收到此错误:
SQL逻辑错误或缺少数据库没有这样的表
数据库与调用它的文件位于同一目录中.
这是我的代码:
SQLiteConnection m_dbConnection = new SQLiteConnection("Data Source=myDatabase.sqlite;Version=3;");
m_dbConnection.Open();
try
{
string sql = "select * from Condition";
SQLiteCommand command = new SQLiteCommand(sql, m_dbConnection);
SQLiteDataReader reader = command.ExecuteReader();
while (reader.Read())
Console.WriteLine("Name: " + reader["name"] + "\tScore: " + reader["id"]);
Console.ReadLine();
return null;
}
catch (Exception exc)
{
return null;
}
finally
{
m_dbConnection.Close();
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
26974 次 |
| 最近记录: |