The modifier 'public' is not valid for this item.
-
Hello, I'm working on a report loader and I'm facing a little problem. I get this error:
The modifier 'public' is not valid for this item.
The code is for making the credentials for viewing the report and is originally from a VB script. I've converted it with a lame online converter but I only get one and the same error at every This is one of the methods:namespace Reports { public class ReportServerConnection : IReportServerConnection { public bool Microsoft.Reporting.WebForms.IReportServerCredentials.GetFormsCredentials(ref System.Net.Cookie authCookie, ref string userName, ref string password, ref string authority) { authCookie = null; userName = null; password = null; authority = null; // Not using form credentials return false; } } }
Anyone an idea? Thanku!Stef
-
Hello, I'm working on a report loader and I'm facing a little problem. I get this error:
The modifier 'public' is not valid for this item.
The code is for making the credentials for viewing the report and is originally from a VB script. I've converted it with a lame online converter but I only get one and the same error at every This is one of the methods:namespace Reports { public class ReportServerConnection : IReportServerConnection { public bool Microsoft.Reporting.WebForms.IReportServerCredentials.GetFormsCredentials(ref System.Net.Cookie authCookie, ref string userName, ref string password, ref string authority) { authCookie = null; userName = null; password = null; authority = null; // Not using form credentials return false; } } }
Anyone an idea? Thanku!Stef
-
When explicitly implimenting an interface method you can't specify an access modifier as its always going to be public. Remove the public from the method and it'll work fine.
Thank you that worked out fine :) But now i'm getting a second error :(
namespace Reports { [Serializable()] public abstract class ReportServerConnection : IReportServerConnection { // the error comes here bool Microsoft.Reporting.WebForms.IReportServerCredentials.GetFormsCredentials(ref System.Net.Cookie authCookie, ref string userName, ref string password, ref string authority) { authCookie = null; userName = null; password = null; authority = null; // Not using form credentials return false; } } }
the error is :'Microsoft.Reporting.WebForms.IReportServerCredentials.GetFormsCredentials' in explicit interface declaration is not a member of interface
and the second is:'Reports.ReportServerConnection' does not implement interface member 'Microsoft.Reporting.WebForms.IReportServerCredentials.GetFormsCredentials(out System.Net.Cookie, out string, out string, out string)'
any ideas? Thanku!!Stef
-
Thank you that worked out fine :) But now i'm getting a second error :(
namespace Reports { [Serializable()] public abstract class ReportServerConnection : IReportServerConnection { // the error comes here bool Microsoft.Reporting.WebForms.IReportServerCredentials.GetFormsCredentials(ref System.Net.Cookie authCookie, ref string userName, ref string password, ref string authority) { authCookie = null; userName = null; password = null; authority = null; // Not using form credentials return false; } } }
the error is :'Microsoft.Reporting.WebForms.IReportServerCredentials.GetFormsCredentials' in explicit interface declaration is not a member of interface
and the second is:'Reports.ReportServerConnection' does not implement interface member 'Microsoft.Reporting.WebForms.IReportServerCredentials.GetFormsCredentials(out System.Net.Cookie, out string, out string, out string)'
any ideas? Thanku!!Stef