我想用 C# 从 SQLite 数据库中读出双精度值和日期。数据库:日期:数字金钱:真实代码:SQLiteConnection dbConnection = new SQLiteConnection("Data Source = " + nameDB + ".sqlite; Version = 3;");dbConnection.Open();String sql = $"SELECT * FROM banking";SQLiteCommand command = new SQLiteCommand(sql, dbConnection);SQLiteDataReader reader = command.ExecuteReader();while (reader.Read()){ Console.WriteLine("date: " + Convert.ToDateTime( reader["date"]) ); Console.WriteLine("money: " + reader["money"]);}dbConnection.Close();问题在于我的数据库数据是这样的:date: 28.06.2017 14:45:24money: 20,50我的输出是这样的:reader[date]: 28,06reader[money]: 20 我可以说读者阅读moneyasdouble和dateasDateTime吗?
- 2 回答
- 0 关注
- 187 浏览
添加回答
举报
0/150
提交
取消