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;
        }
    }

posted @ 2014-04-17 10:14  放哨De老鼠  阅读(312)  评论(0编辑  收藏  举报