public int ExecuteNonQuery() { if (_command != null) { _command.Parameters.Clear(); foreach (AdomdParameter param in Parameters) { _command.Parameters.Add(new Microsoft.AnalysisServices.AdomdClient.AdomdParameter(param.Name, param.Value)); } return(_command.ExecuteNonQuery()); } else { int f() { _objExcel.Parameters.Clear(); foreach (AdomdParameter param in Parameters) { _objExcel.Parameters.Add(new ExcelAdomdClientReference::Microsoft.AnalysisServices.AdomdClient.AdomdParameter(param.Name, param.Value)); } return(_objExcel.ExecuteNonQuery()); } return(f()); } }
public int ExecuteNonQuery() { if (_obj != null) { _obj.Parameters.Clear(); foreach (AdomdParameter param in _parameters) { _obj.Parameters.Add(new Microsoft.AnalysisServices.AdomdClient.AdomdParameter(param.Name, param.Value)); } return(_obj.ExecuteNonQuery()); } else { ExcelAdoMdConnections.ReturnDelegate <int> f = delegate { _objExcel.Parameters.Clear(); foreach (AdomdParameter param in _parameters) { _objExcel.Parameters.Add(new ExcelAdomdClientReference::Microsoft.AnalysisServices.AdomdClient.AdomdParameter(param.Name, param.Value)); } return(_objExcel.ExecuteNonQuery()); }; return(f()); } }