Hi all
I have a datagridview, and I want it to show and enable editing of a
table in my mysql database.
I get the results from the sql-query into the dataset, and when I view
the dataset in the debuger with the dataset viewer, I can see that the
dataset is filled with my data, but the datagridview is all grey,
showing no columns and no data.
I cannot figure out what's wrong/missing.
string sqlString = "SELECT * FROM vehicle";
OdbcCommand cm = new OdbcCommand(sqlString, OdbcCon);
DataAdapter da = new OdbcDataAdapter(cm);
da.TableMappings.Add("Table", "vehicle");
DataSet ds = new DataSet("vehicle");
da.Fill(ds);
dataGridView1.AutoGenerateColumns = true;
dataGridView1.DataSource = ds;
--
K