Click here to Skip to main content
15,879,535 members
Home / Discussions / C#
   

C#

 
QuestionThis operation would create an incorrectly structured document. Pin
Jassim Rahma19-Dec-13 10:10
Jassim Rahma19-Dec-13 10:10 
AnswerRe: This operation would create an incorrectly structured document. Pin
Ravi Bhavnani19-Dec-13 10:49
professionalRavi Bhavnani19-Dec-13 10:49 
GeneralRe: This operation would create an incorrectly structured document. Pin
Manfred Rudolf Bihy19-Dec-13 12:22
professionalManfred Rudolf Bihy19-Dec-13 12:22 
GeneralRe: This operation would create an incorrectly structured document. Pin
Jassim Rahma19-Dec-13 22:13
Jassim Rahma19-Dec-13 22:13 
GeneralRe: This operation would create an incorrectly structured document. Pin
JV999919-Dec-13 22:58
professionalJV999919-Dec-13 22:58 
GeneralRe: This operation would create an incorrectly structured document. Pin
Richard Deeming20-Dec-13 1:55
mveRichard Deeming20-Dec-13 1:55 
AnswerRe: This operation would create an incorrectly structured document. Pin
Ravi Bhavnani20-Dec-13 2:10
professionalRavi Bhavnani20-Dec-13 2:10 
AnswerRe: This operation would create an incorrectly structured document. Pin
Ravi Bhavnani20-Dec-13 2:10
professionalRavi Bhavnani20-Dec-13 2:10 
Try this:
xml_document = new XDocument();
xml_document.Declaration = new XDeclaration("1.0", "utf-8", "true");
XElement rootEle = new XElement("EventLog")
xml_document.Add(rootEle);

XElement event_node = new XElement("Event", new XAttribute("ID", Guid.NewGuid().ToString()));
XElement event_date = new XElement("DateTime", DateTime.UtcNow.ToString("ddd dd MMM yyyy HH:mm:ss"));
XElement event_details = new XElement("Description", event_description);
event_node.Add(event_date);
event_node.Add(event_details);
 
// Append element to root
rootEle.Add(event_node);
 
xml_document.Save("eventlog.xml");

/ravi
My new year resolution: 2048 x 1536
Home | Articles | My .NET bits | Freeware
ravib(at)ravib(dot)com

GeneralRe: This operation would create an incorrectly structured document. Pin
Jassim Rahma20-Dec-13 2:15
Jassim Rahma20-Dec-13 2:15 
Questiondetermine if Google Drive is installed and what's its drive? Pin
Jassim Rahma19-Dec-13 7:28
Jassim Rahma19-Dec-13 7:28 
AnswerRe: determine if Google Drive is installed and what's its drive? Pin
Eddy Vluggen19-Dec-13 7:52
professionalEddy Vluggen19-Dec-13 7:52 
AnswerRe: determine if Google Drive is installed and what's its drive? Pin
BillWoodruff19-Dec-13 8:40
professionalBillWoodruff19-Dec-13 8:40 
QuestionIncrease performance of csv Pin
sjs4u19-Dec-13 2:46
sjs4u19-Dec-13 2:46 
AnswerRe: Increase performance of csv Pin
Dave Kreskowiak19-Dec-13 3:14
mveDave Kreskowiak19-Dec-13 3:14 
AnswerRe: Increase performance of csv Pin
BillWoodruff19-Dec-13 3:23
professionalBillWoodruff19-Dec-13 3:23 
AnswerRe: Increase performance of csv Pin
Ennis Ray Lynch, Jr.19-Dec-13 3:33
Ennis Ray Lynch, Jr.19-Dec-13 3:33 
SuggestionRe: Increase performance of csv Pin
Richard Deeming19-Dec-13 3:43
mveRichard Deeming19-Dec-13 3:43 
AnswerRe: Increase performance of csv Pin
Eddy Vluggen19-Dec-13 7:57
professionalEddy Vluggen19-Dec-13 7:57 
AnswerRe: Increase performance of csv Pin
Mycroft Holmes19-Dec-13 12:03
professionalMycroft Holmes19-Dec-13 12:03 
AnswerRe: Increase performance of csv Pin
jschell19-Dec-13 14:15
jschell19-Dec-13 14:15 
QuestionNHibernate cascade delete not work Pin
LIttle_Cat19-Dec-13 1:30
LIttle_Cat19-Dec-13 1:30 
AnswerRe: NHibernate cascade delete not work Pin
Eddy Vluggen19-Dec-13 8:00
professionalEddy Vluggen19-Dec-13 8:00 
GeneralRe: NHibernate cascade delete not work Pin
LIttle_Cat20-Dec-13 2:02
LIttle_Cat20-Dec-13 2:02 
Questionproblem with RDLC after deploying the application Pin
Jassim Rahma18-Dec-13 23:49
Jassim Rahma18-Dec-13 23:49 
AnswerRe: problem with RDLC after deploying the application Pin
Dave Kreskowiak19-Dec-13 1:15
mveDave Kreskowiak19-Dec-13 1:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.