标签:type table oar each 缓存 process datatable 名称 tostring
DataTable把数据映射到本地缓存表中
DataTable datable = new DataTable (); //使用指定列名称和数据类型初始化 DataColumn colum = new DataColumn(); //取列的数据类型 column.ColumnName = "ID"; colum.DataType=typeof(Int32); colum.AutoIncreament = true;//值自增长 colum.AutoIncreamentSeed = 1;//初始值为1 datable.Columns.Add(column); datable.Columns.Add(new DataColumn("进程",typeof(steing))); string[]proecss = System.Diagnostics.Process.GetProcesses().Select(p= >p.ProcessName).ToArray(); foreach (string p in process) { DataRow row = datable.NewRow(); row[1] = p; datable.Rows.Add(row); } foreach(DataRow dr in datable.Rows) { listBox1.Items.Add(dr[1].ToString()); }
标签:type table oar each 缓存 process datatable 名称 tostring
原文地址:http://www.cnblogs.com/shuize/p/7466222.html