how can make table, excel table, show contents of 2 dimensional dynamic array in visual studio?
i see in visual studio 2008 there table object added form, can't seem find similar in 2013. datagridview seems job involves creating sql database?
the datagridview
solution. don't need sql database. fill datatable
data (row row) , set data source of datagridview
datatable
.
// create , populate datatable datatable datatable = new datatable(); datacolumn[] columns = {new datacolumn("id"), new datacolumn("value")}; object[] row1 = {"1", "value1"}; object[] row2 = {"2", "value2"}; object[] row3 = {"3", "value3"}; datatable.columns.addrange(columns); datatable.rows.add(row1); datatable.rows.add(row2); datatable.rows.add(row3); //set data source datagridview.datasource = datatable;
Comments
Post a Comment