日期:2014-05-17  浏览次数:21525 次

C#中DataTable的使用,新手求助
本人是学习VC/MFC的,最近工作需要紧急修改一个C#程序,遇到各种不明白的地方,请大家指教。
先上代码:

                        for (int i = 0; i < count; i++)
                        {
                            DataRow dr;
                            dr = dt.NewRow();
                            dr[0] = true;//false
                            dr[1] = "0";
                            dr[2] = testfilelist.result[i].releaseDate;
                            dr[3] = testfilelist.result[i].latestVersion;
                            dr[4] = testfilelist.result[i].language;
                            dr[5] = "0";//FILESIZE
                            dr[6] = testfilelist.result[i].filename;   //文件名称
                            dr[7] = testfilelist.result[i].ftpPath;   //将文件名存这
                            dr[8] = testfilelist.result[i].downloadPath;
                            dt.Rows.Add(dr);
                            dt.AcceptChanges();
                        }
                        dtdistinct.Clear();
                        dtdistinct = dt.DefaultView.ToTable(true, new string[] { "Item", "SoftWare", "Date", "Index", "Filesize" });
          &nbs