public class Program
{
static void Main(string[] args)
{
DataTable dt = dtss();
foreach (DataRow dr in dt.Rows)
{
Console.WriteLine(dr["ID"]);
}
//Console.WriteLine(dt.Columns["Name"]);
Console.ReadKey();
}
public static DataTable dtss()
{
DataTable dt = new DataTable();
dt.Columns.Add("ID");
dt.Columns.Add("Name");
//Console.Write(dt.Columns["ID"]);
//Console.WriteLine(dt.Columns["Name"]);
for (int i = 0; i < 6; i++)
{
DataRow dr = dt.NewRow();
object[] objs = { i, "名称&
{
static void Main(string[] args)
{
DataTable dt = dtss();
foreach (DataRow dr in dt.Rows)
{
Console.WriteLine(dr["ID"]);
}
//Console.WriteLine(dt.Columns["Name"]);
Console.ReadKey();
}
public static DataTable dtss()
{
DataTable dt = new DataTable();
dt.Columns.Add("ID");
dt.Columns.Add("Name");
//Console.Write(dt.Columns["ID"]);
//Console.WriteLine(dt.Columns["Name"]);
for (int i = 0; i < 6; i++)
{
DataRow dr = dt.NewRow();
object[] objs = { i, "名称&