日期:2014-05-18 浏览次数:20585 次
/// <summary> /// 获取指定表中的数据,返回一个DataSet,重载1 /// </summary> /// <param name="SqlOrder">一个完整的SQL语句</param> /// <returns>返回一个已填充了TableName中所有表数据的DataSet对象</returns> public DataSet GetData(string SqlOrder) { DataSet myDataSet = new DataSet(); try { this.myCon.Open(); OleDbDataAdapter myAdapter = new OleDbDataAdapter(SqlOrder, this.myCon); myAdapter.Fill(myDataSet); int i=myDataSet.Tables[0].Rows.Count; } catch { throw (new Exception("读取数据失败!!!")); } finally { this.myCon.Close(); } return myDataSet; }