or
public static List<ALERT> Load() { List<ALERT> myList = new List<ALERT>(); AlertServices.AlertServiceClient AlertClient = new AlertServices.AlertServiceClient(); AlertClient.ClientCredentials.UserName.UserName = "usrName"; AlertClient.ClientCredentials.UserName.Password = "password"; ALERT[] dtAlerts = AlertClient.getAllAlerts(); foreach (ALERT alrt in dtAlerts ) { myList.Add(alrt); } AlertClient.Close(); return myList; }An error has occurred while processing Report 'AllAlerts': Exception has been thrown by the target of an invocation. ------------- InnerException ------------- Could not find default endpoint element that references contract 'AlertServices.IAlertService' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element. Telerik Reporting v5.0 trial version. Copyright Telerik © 2002-2011. To remove this message, please obtain a commercial version from www.telerik.com <?xml version="1.0" encoding="utf-8" ?> <configuration> <system.serviceModel> <bindings> <wsHttpBinding> <binding name="wsHttpAlrEndpoint" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxReceivedMessageSize="1024000" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false"> <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" /> <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" /> <security mode="Message"> <transport clientCredentialType="Windows" proxyCredentialType="None" realm="" /> <message clientCredentialType="UserName" negotiateServiceCredential="true" algorithmSuite="Default" /> </security> </binding> </wsHttpBinding> </bindings> <client> <endpoint address="http://muaath.local/TRDWCFSurv/TRDWCFSurvServices.AlertService.svc" binding="wsHttpBinding" bindingConfiguration="wsHttpAlrEndpoint" contract="AlertServices.IAlertService" name="wsHttpAlrEndpoint"> <identity> <certificate encodedValue="AwAAAAEAAAAUAAAAxtusZ48yxeG84lIeb9af1Wg7ib8gAAAAAQAAAMwBAAAwggHIMIIBNaADAgECAhDGybGTRx4Fg0xdc1+CAK0SMAkGBSsOAwIdBQAwETEPMA0GA1UEAxMGSWRDZXJ0MCAXDTEwMDMyNDEyMDI1MloYDzQwMDgxMTI0MTIwMjUyWjARMQ8wDQYDVQQDEwZJZENlcnQwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAKl6oADCxSKQ+isZMfBzjafbEDPmE9Hn6yStKCoXjGlskH5Yqmwp7q4hrLbPmJT7iE4NEtmtJ9MCmXxJuGJuT8mgVadzAHNFnlHCG0DhdZJrg4tSe+vOo0yYVq96zMH6I8QCLyALBS15bdWcG0QpOa5mm6ZeO9hp23cYwJhgeHiPAgMBAAGjJzAlMBMGA1UdJQQMMAoGCCsGAQUFBwMBMA4GA1UdDwQHAwUAsAAAADAJBgUrDgMCHQUAA4GBAEGNLlMfqLpAx8fg35D/NVZIbE2psK2M7BgiTOd/KFgYTbiWT/I7zfPlcQ1DFQ59NtuVbODVsTCZQdmmNr6iZIEnEBsdfsdfjsdfjklsdf78sdjfkjsdklf8Y4XXNQMpIcjcTK+dpM6KcnK4ocmLhXzLbgKcR5YUWmsdxSdt" /> </identity> </endpoint> </client> </system.serviceModel> </configuration>var report = new TestReport(); var ods = new Telerik.Reporting.ObjectDataSource(); ods.DataSource = instanceOfFoo; report.DataSource = ods; instanceReportSource.ReportDocument = report; ReportViewer.ReportSource = instanceReportSource;
public static string ReturnRiskLeveltext(int rId){ using (DataEntities ctx = new DataEntities()) { var RiskLevel = ctx.RiskLevels.Where(x => x.RiskLevelID == rId).SingleOrDefault(); return RiskLevel.Level; }}= Avg(Fields.RiskLevel)= ReturnRiskLeveltext(Avg(Fields.RiskLevel))