程序报错,代码如下:
……
            goodslist = dset.Tables[0];
            if (destinationid != 0)
            {
                string cityName = new Place().getModel(destinationid).ShortName.Replace('*', '%');
                DataRow[] rows = goodslist.Select("DestinationId <> 0 or (DestinationId = 0 and title like '%" + cityName + "%')");                //goodslist = new DataTable();
                //foreach (DataRow _r in rows)
                //    goodslist.ImportRow(_r);
                goodslist.Rows.Clear();
                foreach (DataRow _r in rows)
                    goodslist.Rows.Add(_r.ItemArray);//ItemArray
            }
我是初学者望高手不吝赐教。
本意是将goodslist中不符合条件的部分筛选掉。