TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Smart Lucky
NA
555
639.2k
Exception at the time of Writing xml File
Apr 15 2011 4:04 AM
hi
I am writing following program means i want to write an xml file but value com from database but it is giving me an exception can any one help me.....?
Token StartAttribute in state Element Content would result in an invalid XML document. ///
This is Exception which is thrown
XmlWriter DocWrite = XmlWriter.Create(Server.MapPath("~/MyProfile.xml"));
string source = @"server=KBBALOCH-PC\SQLEXPRESS; integrated security=true; database=test";
con = new SqlConnection(source);
con.Open();
string query = "select * from Table_1";
cmd = new SqlCommand(query, con);
reader = cmd.ExecuteReader();
DocWrite.WriteStartDocument();
DocWrite.WriteStartElement("BioDATA");
while (reader.Read())
{
DocWrite.WriteStartElement("Name");
DocWrite.WriteElementString("FName", reader["name"].ToString());
DocWrite .WriteAttributeString("Gender",reader["gender"].ToString());
DocWrite.WriteEndElement();
}
DocWrite.WriteEndElement();
DocWrite.WriteEndDocument();
DocWrite.Close();
con.Close();
Reply
Answers (
2
)
how can i add confirm box in asp.net
Create Hyperlink in ASP.NET