//获取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; } }
//批量执行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; } }