C# - System.Xml.XmlException: '@' Character Error

bluedevil

New Member
I am having an issue with this bit of code.\[code\] XMLParameter param1 = new XMLParameter(); TabletWebService service1 = ModuleName.MainWebService(); param1.Add(ModuleName.AuthorityKey); param1.Add(ModuleName.UserID); param1.Add("@iJobID", jobID); byte[] buffer1 = service1.GetPreviousJobs(param1.ToString(), false);\[/code\]This code uses a stored MS SQL procedure which looks like this:\[code\]create procedure [dbo].[GetPreviousJob]@iJobID intas set nocount onselect pj.*, j.dValuationDatefrom PreviousJobs pj, Jobs jwhere pj.iAttachedID = @iJobID and j.iJobID = pj.iJobID\[/code\]So as you can see i need to use the "@iJobID"The error I am receiving is a common one in google, however I was still not able to find an anwser.ERROR:\[code\]System.Web.Services.Protocols.SoapException: Server was unable to process request.---> System.Xml.XmlException: Name cannot begin with the '@' character, hexadecimal value 0x40. Line 5, position 6.at System.Xml.XmlTextReaderImpl.Throw(Exception e)at System.Xml.XmlTextReaderImpl.Throw(String res, String[] args)at System.Xml.XmlTextReaderImpl.Throw(Int32 pos, String res, String[] args)at System.Xml.XmlTextReaderImpl.ParseQName(Boolean isQName, Int32 startOffset, Int32& colonPos)at System.Xml.XmlTextReaderImpl.ParseElement()at System.Xml.XmlTextReaderImpl.ParseElementContent()at System.Xml.XmlTextReaderImpl.Read()at System.Xml.XmlLoader.LoadNode(Boolean skipOverWhitespace)at System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc)at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)at System.Xml.XmlDocument.Load(XmlReader reader)at System.Xml.XmlDocument.Load(TextReader txtReader)at WBP.Windows.XMLParameter.Load(String sXML) in C:\xpressCentral\WBP.Windows\XMLParameter.cs:line 98at WBP.Windows.XMLParameter..ctor(String sXML) in C:\xpressCentral\WBP.Windows\XMLParameter.cs:line 41at WirelessConnector.GetPreviousJobs(String sParams) in c:\xpressCentral\WBP.WirelessConnector\App_Code\WBP.WirelessConnector.cs:line 234--- End of inner exception stack trace ---\[/code\]I can tell from theis that the @ char is causing the issue, but to properly address the Stored Procedure in SQL, I must include this.Should I try to catch the exception ??\[code\]System.Web.Services.Protocols.SoapException: ???\[/code\]Any ideas ???Thanks AC
 
Back
Top