/// <summary> /// 带参数SQL,并返回结果数据集 /// </summary> /// <param name="strSQL"></param> /// <param name="parm"></param> /// <returns></returns> public DataSet GetOtherDs(string strSQL, Hashtable parm) { string err = ""; if (DataLib.SysVar.intConnect == 0) { JxcService.Service myService = GetService(); byte[] bytes = DataSetCompression.SerializeData(parm); byte[] bUserData = myService.GetOtherByte(ref err, SysVar.strDB, strSQL, bytes); if (err != "") { MessageBox.Show(err, "错误"); err = ""; return(null); } DataSet ds = DataSetCompression.DecompressionDataSet(bUserData); return(ds); } else { CenterLib.Service obj = GetObj(); byte[] bUserData = obj.GetOtherByte(ref err, SysVar.strDB, strSQL, parm); if (err != "") { MessageBox.Show(err, "错误"); err = ""; return(null); } DataSet ds = DataSetCompression.DecompressionDataSet(bUserData); return(ds); } }
/// <summary> /// 根据传过去的SQL语句得到相应数据集 /// </summary> /// <param name="strSQL"></param> /// <returns></returns> public DataSet GetDs(string strSQL) { string err = ""; DataSet ds = null; byte[] bUserData = null; if (DataLib.SysVar.intConnect == 0) { JxcService.Service myService = GetService(); bUserData = myService.GetCompressDataSet(ref err, SysVar.strDB, strSQL); if (err != "") { MessageBox.Show(err, "错误"); err = ""; return(null); } ds = DataSetCompression.DecompressionDataSet(bUserData); return(ds); } else { CenterLib.Service obj = GetObj(); bUserData = obj.GetCompressDataSet(ref err, SysVar.strDB, strSQL); if (err != "") { MessageBox.Show(err, "错误"); err = ""; return(null); } ds = DataSetCompression.DecompressionDataSet(bUserData); return(ds); } }