Wednesday, March 7, 2012

Error1'System.Net.NetworkCredential' is a 'type', which is not valid in the given contextC:\

Hello, I got this error when trying to render, in the line of the credentials, how should I solve it.

rs.Credentials = System.Net.NetworkCredential("levalencia", "123", "se");

ReportingService2005 rs;

private void cargarReporteFromWS()

{

rs = new ReportingService2005();

rs.Credentials = System.Net.NetworkCredential("levalencia", "123123123", "se");

}

Hello,

System.Net.NetworkCredential is not a static method, but a constructor, so you need to use the "new" keyword.

rs.Credentials = new System.Net.NetworkCredential("levalencia", "123", "se");

No comments:

Post a Comment