Get XML Element By Tag Name using C#

I was working with creating a job using the SalesForce Bulk API
and i needed to get the JobId from API Response

<?xml version="1.0" encoding="UTF-8"?>

Use following function to get the Job Id by passing in the XML

private string GetID(string xmlString)
XmlDocument doc = new XmlDocument();
XmlNodeList node = doc.GetElementsByTagName("id");
return node.Item(0).InnerText;

Get Free Email Updates!

Signup now and receive free offers, discounts & coupon codes

I agree to have my personal information transfered to Mad Mimi ( more information )

I will never give away, trade or sell your email address. You can unsubscribe at any time.

1 thought on “Get XML Element By Tag Name using C#

  1. I must say it was hard to find your page in search results.
    You write great posts but you should rank your blog higher
    in search engines.
    33Sylvester recently posted…33SylvesterMy Profile

Leave a Reply

Your email address will not be published. Required fields are marked *

CommentLuv badge

This site uses Akismet to reduce spam. Learn how your comment data is processed.