以下のコードを使用して、日付列を含む SQLite3 データベースからプログラムにデータ グリッド ビューを作成しています。
この日付列はUnix時間で保存されており、明らかに通常の日付として表示したい
データベースをデータ グリッド ビューに読み込んでいるときに、これを行う方法はありますか?
SQLiteConnectionStringBuilder csb = new SQLiteConnectionStringBuilder();
csb.DataSource = Path.Combine(connectionPath, "sms.db");
SQLiteConnection connection = new SQLiteConnection(csb.ConnectionString);
connection.Open();
// SQL query to read the data fromt he database
SQLiteCommand command = connection.CreateCommand();
//Read Everything
string query = "SELECT * FROM message";
command.CommandText = query;
SQLiteDataAdapter dataAdaptor = new SQLiteDataAdapter(command);
DataSet dataset = new DataSet();
dataAdaptor.Fill(dataset, "Messages");
// Get the table from the data set
DataTable datatable = dataset.Tables["Messages"];
dataGridSMS.DataSource = datatable;