Im working with a Sqlite database in C#, when I insert my date into it, everything works fine (in the format MM.YYYY
). Nevertheless when I update the database, sqlite cuts off leading zeros, so 09.2019
appears as 9.2019
. But it's important for further operations that the leading zero remains in it's place.
When creating the table "credits", I use TEXT for the date to store it.
I show you some code how I update the database:
SQLiteCommand command = new SQLiteCommand(databaseConnection);
command.CommandText = "Update credits Set lastDate = " + date +
" WHERE ID=" + Convert.ToString(index);
command.ExecuteScalar();
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…