I have a Data table and I want to enter a row at the beginning and end of the table how can I achieve this:
c# code:
Guid tempGuid1 = new Guid();
dt1.Rows[0]["ID"] = tempGuid1;
dt1.Rows[0]["Name"] = "Select a WishList";
Guid tempGuid = new Guid();
dt1.Rows.Add(tempGuid, "Create a new WishList");
Ok after I fill the table i want to enter a brand new row at top of the table
Guid tempGuid1 = new Guid();
dt1.Rows[0]["ID"] = tempGuid1;
dt1.Rows[0]["Name"] = "Select a WishList";
and than at the end of the table
Guid tempGuid = new Guid();
dt1.Rows.Add(tempGuid, "Create a new WishList");
I can enter at the end but the brand new row giving me problems, currently the code overwrites the top row which is row[0]
. Thanks for any help appreciated.