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.

enter image description here

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

Popular posts from this blog

sql server - Cannot query correctly (MSSQL - PHP - JSON) -

php - trouble displaying mysqli database results in correct order -

C++ Linked List -