예제 #1
0
 //获取DataTable从SAP数据源
 public static DataTable GetDtSap(string StrSql)
 {
     try
     {
         System.ServiceModel.Channels.Binding binding = ServiceBaseClient.CreateDefaultBinding();
         string            remoteAddress = url;
         EndpointAddress   endpoint      = new EndpointAddress(remoteAddress);
         ServiceBaseClient client        = new ServiceBaseClient(binding, endpoint);
         return(client.GetDtSap(StrSql));
     }
     catch (Exception)
     {
         throw;
     }
 }
예제 #2
0
        //批量执行sql
        public static Result RunSqls(List <string> strSqls)
        {
            try
            {
                System.ServiceModel.Channels.Binding binding = ServiceBaseClient.CreateDefaultBinding();
                string            remoteAddress = url;
                EndpointAddress   endpoint      = new EndpointAddress(remoteAddress);
                ServiceBaseClient client        = new ServiceBaseClient(binding, endpoint);

                return(client.RunSqls(strSqls.ToArray()));
            }
            catch (Exception)
            {
                throw;
            }
        }