Hello ,
Why you are trying to insert new row at the top position of the Table by below code
dts.Rows.InsertAt(dts.NewRow(),0)
hence slno changed respectively. Simply add Row by
Add
method instead of
Insert
method.
DataRow dr = dts.NewRow();
dr[0] = "coldata1";
dr[1] = "coldata2";
dr[2] = "coldata3";
dr[3] = "coldata4";
dts.Rows.Add(dr);
Thanks