data til Gridview
Jeg har stirret mig blind, hvad mangler jeg?con.Open();
string sqlcmd = "SELECT * FROM Books";
SqlDataAdapter da = new SqlDataAdapter(sqlcmd, connStr);
SqlCommandBuilder catCB = new SqlCommandBuilder(da);
da.UpdateCommand = catCB.GetUpdateCommand();
da.DeleteCommand = catCB.GetDeleteCommand();
da.InsertCommand = catCB.GetInsertCommand();
DataSet ds = new DataSet();
da.Fill(ds, "books");
booksDataGridView.DataSource = ds;
booksDataGridView.DataMember = "books";