I have a DataGridView that I'm trying to pull data to from an SQLite database.
The structure of the DataGridView is:
TaskName : StringTaskDueDate : StringStatus : ComboBox
Code:
String SelectQuery = "Select TaskName,TaskDue,Status from TASKS Order BY Status";
SQLiteConnection slite = new SQLiteConnection("data source = Dash.sqlite");
slite.Open();
SQLiteDataAdapter data = new SQLiteDataAdapter(SelectQuery, slite);
SQLiteCommandBuilder Command = new SQLiteCommandBuilder(data);
DataTable table = new DataTable();
data.Fill(table);
MyTasksGrid.AutoGenerateColumns = false;
MyTasksGrid.DataSource = table;
I've spent the past few hours on here looking at several question including this one, however it was producing the exact same results for me as the code above.
This question also suggests my code is correct from the accepted answer?
I get the correct amount of rows showing up in the grid, but all the cells are blank. If I remove the AutoGeneratColumns line it adds the data but in new columns, which I don't want. (I want it to be added in the already defined columns.)
Could anyone give me a hand to see where I am going wrong?