网站建设资讯

NEWS

网站建设资讯

(C#基础)Datatable-创新互联

增加一行:(C#基础)Datatable
DataTable measurements = new DataTable();
                                measurements.Columns.Add("StationTestName", typeof(string));
                                measurements.Columns.Add("SerialNumber", typeof(string));
                                measurements.Columns.Add("MeasurementName", typeof(string));
                                measurements.Columns.Add("Unit", typeof(string));
                                measurements.Columns.Add("Value", typeof(string));
                                measurements.Columns.Add("LowerLimit", typeof(string));
                                measurements.Columns.Add("UpperLimit", typeof(string));
                                measurements.Rows.Add(
                                    stationTestName,
                                    serialNumber,
                                    measurementSplits[0],
                                    measurementSplits[1],
                                    measurementSplits[2],
                                    measurementSplits[3],
                                    measurementSplits[4]);

取指定的其中一列的值:

创新互联主要从事成都网站制作、网站设计、网页设计、企业做网站、公司建网站等业务。立足成都服务来凤,10年网站建设经验,价格优惠、服务专业,欢迎来电咨询建站服务:18980820575

How to Get a Specific Column Value from a DataTable?

datatable1.AsEnumerable().Select(r => r.Field("Name")).ToArray(); datatable1.Rows.Cast().Select(r => r.ItemsArray[0].ToString())
当前标题:(C#基础)Datatable-创新互联
浏览地址:http://njwzjz.com/article/pocpc.html