as new to C# and SQLite world, how can i possibly display data from SQLite in the DataGridView in C#? I really don't have any idea on how to do it. Even I tried some tutorials from the internet but I don't get it right. And most of them are using MySQL.
When the references are added, you can write queries, like
using (var conn = new SQLiteConnection(@"Data Source=test.db3"))
using (var cmd = conn.CreateCommand())
{
conn.Open();
cmd.CommandText = "SELECT * FROM random_table_name";
using (var reader = cmd.ExecuteReader())
{
while (reader.Read())
{
string name = reader.GetString(reader.GetOrdinal("name"));
...
}
}
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.