i ahve eeror in this code any one solve this error plz its urgent.............
this is my aspx.cs code..........
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Xml;
public partial class Default2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
XmlTextReader reader = new XmlTextReader("C:\\Documents and Settings\azhar\\Desktop");
XmlNodeType type;
while (reader.Read())
{
type = reader.NodeType;
if (type == XmlNodeType.Element)
{
if (reader.Name == "NMBM Test")
{
reader.Read();
ListBox1.Items.Add(reader.Value);
}
}
reader.Close();
}
}
}
and this is my XMLFile.xml code...........
="1.0"="utf-8"
<DocumentElement>
<Location>
<id>NMBM Test</id>
<DataBaseName>ICMAStest</DataBaseName>
<WebServerName>ICMAS-TEST</WebServerName>
<DataBaseServerName>ICMAS-TEST\SQLEXPRESS</DataBaseServerName>
<ClientSettingsProvider.ServiceUri />
<RptUrl>http://icmas-test/ReportServer_SQLEXPRESS</RptUrl>
<ReportPath>/ICMASReports/</ReportPath>
<ReportServerUserName>NALIN</ReportServerUserName>
<ReportServerPassword>temp123</ReportServerPassword>
<SMTPServerId>10.100.0.80</SMTPServerId>
</Location>
<Location>
<id>NMBM Production</id>
<DataBaseName>ICMAStest</DataBaseName>
<WebServerName>ICMAS-TEST</WebServerName>
<DataBaseServerName>ICMAS-TEST\SQLEXPRESS</DataBaseServerName>
<ClientSettingsProvider.ServiceUri />
<RptUrl>http://icmas-test/ReportServer_SQLEXPRESS</RptUrl>
<ReportPath>/ICMASReports/</ReportPath>
<ReportServerUserName>NALIN</ReportServerUserName>
<ReportServerPassword>temp123</ReportServerPassword>
<SMTPServerId>10.100.0.80</SMTPServerId>
</Location>
<Location>
<id>ICMASDev Satish</id>
<DataBaseName>ICMAStest</DataBaseName>
<WebServerName>192.168.0.178</WebServerName>
<DataBaseServerName>epmpune\ciodevdb</DataBaseServerName>
<ClientSettingsProvider.ServiceUri />
<RptUrl>http://icmas-test/ReportServer_SQLEXPRESS</RptUrl>
<ReportPath>/ICMASReports/</ReportPath>
<ReportServerUserName>NALIN</ReportServerUserName>
<ReportServerPassword>temp123</ReportServerPassword>
<SMTPServerId>10.100.0.80</SMTPServerId>
</Location>
<Location>
<id>ICMAS Test icmastest-userpc2</id>
<DataBaseName>ICMASQA</DataBaseName>
<WebServerName>userpc2</WebServerName>
<DataBaseServerName>epmpune\ciodevdb</DataBaseServerName>
<ClientSettingsProvider.ServiceUri />
<RptUrl>http://userpc2/ReportServer_SQLEXPRESS</RptUrl>
<ReportPath>/userpc2/</ReportPath>
<ReportServerUserName>NALIN</ReportServerUserName>
<ReportServerPassword>temp123</ReportServerPassword>
<SMTPServerId>mail.24by7cio.com</SMTPServerId>
</Location>
<Location>
<id>ICMASQA</id>
<DataBaseName>ICMASQA</DataBaseName>
<WebServerName>192.168.0.178</WebServerName>
<DataBaseServerName>epmpune\ciodevdb</DataBaseServerName>
<ClientSettingsProvider.ServiceUri />
<RptUrl>http://userpc2/ReportServer_SQLEXPRESS</RptUrl>
<ReportPath>/userpc2/</ReportPath>
<ReportServerUserName>NALIN</ReportServerUserName>
<ReportServerPassword>temp123</ReportServerPassword>
<SMTPServerId>mail.24by7cio.com</SMTPServerId>
</Location>
</DocumentElement>
error........
Server Error in '/WebSite25' Application.
Illegal characters in path.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentException: Illegal characters in path.
Source Error:
Line 17: XmlTextReader reader = new XmlTextReader("C:\\Documents and Settings\azhar\\Desktop");
Line 18: XmlNodeType type;
Line 19: while (reader.Read())
Line 20:
Line 21: {