facing error for inserting xml data into database table using c#
<p>i am just trying to insert my xml data into table through calling store procedure. i doubt something is wrong in my xml and that is why i am getting the error.</p>

<h2>my xml is bit large &amp; here i am giving just partial</h2>

<pre><code>&lt;?xml version='1.0' encoding='UTF-8' ?&gt;
&lt;soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'   xmlns:ns='http://fedex.com/ws/ship/v9' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'&gt;
&lt;soapenv:Body&gt;
&lt;ns:ProcessShipmentRequest&gt;
&lt;ns:WebAuthenticationDetail&gt;
&lt;ns:UserCredential&gt;
&lt;ns:Key&gt;aaaaaa&lt;/ns:Key&gt;
&lt;ns:Password&gt;aaaaaa&lt;/ns:Password&gt;
&lt;/ns:UserCredential&gt;
&lt;/ns:WebAuthenticationDetail&gt;
&lt;ns:ClientDetail&gt;
&lt;ns:AccountNumber&gt;aaaaaa&lt;/ns:AccountNumber&gt;
&lt;ns:MeterNumber&gt;aaaaaa&lt;/ns:MeterNumber&gt;
&lt;/ns:ClientDetail&gt;
&lt;ns:TransactionDetail&gt;
&lt;ns:CustomerTransactionId&gt;ProcessShipmentRequest_DG_HAL&lt;/ns:CustomerTransactionId&gt;
&lt;/ns:TransactionDetail&gt;
&lt;ns:Version&gt;
&lt;ns:ServiceId&gt;ship&lt;/ns:ServiceId&gt;
&lt;ns:Major&gt;9&lt;/ns:Major&gt;
&lt;ns:Intermediate&gt;0&lt;/ns:Intermediate&gt;
&lt;ns:Minor&gt;0&lt;/ns:Minor&gt;
&lt;/ns:Version&gt;
&lt;ns:RequestedShipment&gt;
&lt;ns:ShipTimestamp&gt;2011-11-03T06:50:40&lt;/ns:ShipTimestamp&gt;
&lt;ns:DropoffType&gt;REGULAR_PICKUP&lt;/ns:DropoffType&gt;
&lt;ns:ServiceType&gt;FEDEX_GROUND&lt;/ns:ServiceType&gt;
&lt;ns:PackagingType&gt;YOUR_PACKAGING&lt;/ns:PackagingType&gt;
&lt;ns:TotalWeight&gt;
&lt;ns:Units&gt;LB&lt;/ns:Units&gt;
&lt;ns:Value&gt;1.0&lt;/ns:Value&gt;
&lt;/ns:TotalWeight&gt;
&lt;ns:Shipper&gt;
&lt;ns:AccountNumber&gt;aaaaaa&lt;/ns:AccountNumber&gt;
&lt;ns:Contact&gt;
&lt;ns:CompanyName&gt;test&lt;/ns:CompanyName&gt;
&lt;ns:PhoneNumber&gt;11111111&lt;/ns:PhoneNumber&gt;
&lt;/ns:Contact&gt;
&lt;ns:Address&gt;
</code></pre>

<h2>here is my c# code for calling store proc to insert data into table</h2>

<pre><code>private void SaveData(string CompanyName, string Attention, string Address1, string Address2, string Country, string PostalCode, string City, string State, string Telephone, string UPSService, bool isInsured, string IdentificationNo,  string RequestXml, string ResponseXml)
    {
        Database DB = GlobalObjects.GetInstance().DB;
        using (DbCommand cmd = DB.GetStoredProcCommand("InsLabelDetail"))
        {
            DB.AddInParameter(cmd, "@IdentificationNo", DbType.String, IdentificationNo);
            DB.AddInParameter(cmd, "@CompanyName", DbType.String, CompanyName);
            DB.AddInParameter(cmd, "@Attention", DbType.String, Attention);
            DB.AddInParameter(cmd, "@add1", DbType.String, Address1);
            DB.AddInParameter(cmd, "@add2", DbType.String, Address2);
            DB.AddInParameter(cmd, "@Country", DbType.String, Country);
            DB.AddInParameter(cmd, "@PostalCode", DbType.String, PostalCode);
            DB.AddInParameter(cmd, "@City", DbType.String, City);
            DB.AddInParameter(cmd, "@State", DbType.String, State);
            DB.AddInParameter(cmd, "@Telephone", DbType.String, Telephone);
            DB.AddInParameter(cmd, "@UPSService", DbType.String, UPSService);
            DB.AddInParameter(cmd, "@isInsured", DbType.Int32, (isInsured==true ? 1 : 0));
            DB.AddInParameter(cmd, "@shipto", DbType.String, Country);
            DB.AddInParameter(cmd, "@RequestXML", DbType.Xml, RequestXml.Replace("encoding='UTF-8'", string.Empty));
            DB.AddInParameter(cmd, "@ResponseXML", DbType.Xml, ResponseXml.Replace("encoding='UTF-8'", string.Empty));
            try
            {
                DB.ExecuteNonQuery(cmd);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    }
</code></pre>

<p>the error or the exception i am facing like "XML parsing: line 1, character 38, unable to switch the encoding"</p>

<p>please tell me where i made the mistake. thanks</p>
