Пример #1
0
        public static DataSet GetDT(string Bll, string Exc, object[] par)
        {
            ServiceReference1.FileTransportServiceClient ft = new ServiceReference1.FileTransportServiceClient();
            //try
            //{
            //    byte[] da = ft.getZipData(Bll, Exc, par);
            //    ft.Close();
            //    return Byte2DS(da);
            //}
            //catch (Exception ex)
            //{
            //    DataSet ds = new DataSet();
            //    ds.Tables.Add();
            //    return ds;
            //}
            //finally
            //{
            //    ft.Close();
            //}

            try
            {
                byte[]    da = ft.GetJson(Bll, Exc, par);
                DataTable dt = ToDataTable(da);
                DataSet   ds = new DataSet();
                ds.DataSetName = "ds";
                ds.Tables.Add(dt);
                return(ds);
            }
            catch (Exception ex)
            {
                DataSet ds = new DataSet();
                ds.Tables.Add();
                return(ds);
            }
            finally
            {
                ft.Close();
            }
        }