Fork me on GitHub

循环获取DataSet中的数据

var list = Hy.DBSqlU.DBUtility_USA.DbHelperSQLDB_USA_MIT_MitInfo.Query(sql);//dataset数据源

foreach (DataRow mDr in list.Tables[0].Rows)
         {
            //DataColumn mDc = list.Tables[0].Columns[0];
            //Console.WriteLine(mDr["Title"].ToString());
          //Console.WriteLine(mDr["Url"].ToString());

            foreach (DataColumn mDc in list.Tables[0].Columns)
            {
               Console.WriteLine(mDr["Title"].ToString());
            Console.WriteLine(mDr["Url"].ToString());
            }
         }

 

posted @ 2018-06-08 09:08  秋刀鱼de滋味  阅读(3744)  评论(0编辑  收藏  举报