c# - add column in datatable with re-arranging number -
so, in here want add unbound column datatable have been fill, in datatable got column of custom number, , number random. want new added columns re-arranging number 1.
the code use is
public void sdb() { datatable dt = new datatable(); dataset ds = new dataset(); sqldataadapter adapter = new sqldataadapter(command.commandtext, myconnection); try { ds.tables.clear(); dt.clear(); command.connection = myconnection; command.commandtext = "select code gen order code"; myconnection.open(); adapter.selectcommand = command; adapter.fill(ds); adapter.fill(dt); gridcontrol1.datasource = dt; } catch (exception ex) { messagebox.show("error" + ex); } { myconnection.close(); } }

Comments
Post a Comment