How to add new DataRow into DataTable?

后端 未结 8 1266
我在风中等你
我在风中等你 2021-02-02 06:48

I have a DataGridView binded to a DataTable (DataTable binded to database). I need to add a DataRow to the DataTable

8条回答
  •  日久生厌
    2021-02-02 07:10

    You can try with this code - based on Rows.Add method

    DataTable table = new DataTable();
    DataRow row = table.NewRow();
    table.Rows.Add(row);
    

    Link : https://msdn.microsoft.com/en-us/library/9yfsd47w.aspx

提交回复
热议问题