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.

Comments (1)
  1. 33Sylvester May 17, 2017

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.