C# CreateDataTable

public DataTable CreateDataTable()
        {
            DataTable dataTable = new DataTable();
            dataTable.Columns.Add("abc"typeof(string));
            DataRow dataRow = dataTable.NewRow();
            object[] itemArray = new object[]
            {
                "aaaa"
            };
            dataRow.ItemArray = itemArray;
            dataTable.Rows.Add(dataRow);
            return dataTable;
        }
    }

转载于:https://www.cnblogs.com/zhang9418hn/p/3670081.html

你可能感兴趣的:(C# CreateDataTable)