1. 程式人生 > >datatable裡新增一個標識列

datatable裡新增一個標識列

        DataTable dt = new DataTable();
        DataColumn id = new DataColumn("Id");
        id.AutoIncrement = true;
        id.AutoIncrementSeed = 1;
        id.AutoIncrementStep = 1;
        dt.Columns.Add(id);