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
Kyle R
NA
1
3.2k
if else statement in XElement
Jun 10 2014 11:06 PM
I am wondering, how can I add a new XElement by using a if/else statement?
For example...
XDocument document = XDocument.Load(this.XMLFile);
document.Element("currentjobs").Add(
new XElement("job",
new XElement("date", now.ToShortDateString() + " " + now.ToUniversalTime()),
new XElement("name", job.name)
)
);
Now if I wanted to add a new XElement inside the element "job" in that XML by using if/else statement from a variable I have in C#.
The if else statement would be like...
if(job.status == 2)
{
//add XML...
}
How would I go ahead and do this?
Thanks!
Reply
Answers (
1
)
How to read character map font's unicode in list using c#
Why insert new have must "SET IDENTITY_INSERT TableName ON"