Click here to Skip to main content
15,913,055 members
Home / Discussions / C#
   

C#

 
QuestionAT Commands Pin
Wamuti23-Apr-10 11:59
Wamuti23-Apr-10 11:59 
AnswerRe: AT Commands Pin
joey_go23-Apr-10 15:55
joey_go23-Apr-10 15:55 
QuestionCheckbox on the header of a Listview Pin
Natural_Demon23-Apr-10 11:00
Natural_Demon23-Apr-10 11:00 
AnswerRe: Checkbox on the header of a Listview Pin
Ravi Bhavnani23-Apr-10 15:37
professionalRavi Bhavnani23-Apr-10 15:37 
GeneralRe: Checkbox on the header of a Listview Pin
Natural_Demon23-Apr-10 16:15
Natural_Demon23-Apr-10 16:15 
Questionvb.net to c# Pin
toto_201023-Apr-10 7:35
toto_201023-Apr-10 7:35 
AnswerRe: vb.net to c# Pin
Luc Pattyn23-Apr-10 7:41
sitebuilderLuc Pattyn23-Apr-10 7:41 
AnswerRe: vb.net to c# Pin
#realJSOP23-Apr-10 7:46
professional#realJSOP23-Apr-10 7:46 
GeneralRe: vb.net to c# Pin
AspDotNetDev23-Apr-10 15:14
protectorAspDotNetDev23-Apr-10 15:14 
GeneralRe: vb.net to c# Pin
toto_201023-Apr-10 23:41
toto_201023-Apr-10 23:41 
QuestionBeginner Question: Distributing Data Driven Applications Pin
Kris Traughber23-Apr-10 4:59
Kris Traughber23-Apr-10 4:59 
AnswerRe: Beginner Question: Distributing Data Driven Applications Pin
dan!sh 23-Apr-10 5:06
professional dan!sh 23-Apr-10 5:06 
GeneralRe: Beginner Question: Distributing Data Driven Applications Pin
Kris Traughber23-Apr-10 5:22
Kris Traughber23-Apr-10 5:22 
GeneralRe: Beginner Question: Distributing Data Driven Applications Pin
dan!sh 23-Apr-10 5:29
professional dan!sh 23-Apr-10 5:29 
AnswerRe: Beginner Question: Distributing Data Driven Applications Pin
Sandesh M Patil23-Apr-10 5:52
Sandesh M Patil23-Apr-10 5:52 
GeneralRe: Beginner Question: Distributing Data Driven Applications Pin
Kris Traughber23-Apr-10 6:20
Kris Traughber23-Apr-10 6:20 
GeneralRe: Beginner Question: Distributing Data Driven Applications Pin
Sandesh M Patil23-Apr-10 6:54
Sandesh M Patil23-Apr-10 6:54 
AnswerRe: Beginner Question: Distributing Data Driven Applications Pin
kevinnicol23-Apr-10 6:28
kevinnicol23-Apr-10 6:28 
GeneralRe: Beginner Question: Distributing Data Driven Applications Pin
Kris Traughber23-Apr-10 6:47
Kris Traughber23-Apr-10 6:47 
AnswerRe: Beginner Question: Distributing Data Driven Applications Pin
AspDotNetDev23-Apr-10 6:56
protectorAspDotNetDev23-Apr-10 6:56 
GeneralRe: Beginner Question: Distributing Data Driven Applications Pin
Kris Traughber23-Apr-10 7:03
Kris Traughber23-Apr-10 7:03 
AnswerRe: Beginner Question: Distributing Data Driven Applications Pin
Ravi Bhavnani23-Apr-10 15:35
professionalRavi Bhavnani23-Apr-10 15:35 
QuestionC# VS 2008 3.5 XML/Webservice error Pin
Wheels01223-Apr-10 4:51
Wheels01223-Apr-10 4:51 
Good morning.
I am trying to populate City and State fields based on a Zip entered and I am getting an Webservice Data at the root level is invalid. Line 1, position 1. error.

The XML return from the webservice is as follows:
<?xml version="1.0" encoding="utf-8" ?> 
- <NewDataSet> 
- <Table> 
<CITY>Portland</CITY> 
<STATE>ME</STATE> 
<ZIP>04104</ZIP> 
<AREA_CODE>207</AREA_CODE> 
<TIME_ZONE>E</TIME_ZONE> 
</Table> </NewDataSet> 

My code is as follows:
 private void btnZipWS_Click(object sender, EventArgs e) 
{ 
XmlDocument doc = new XmlDocument();  
Bank.net.webservicex.www.USZip ws = new Bank.net.webservicex.www.USZip(); XElement Results = XElement.Parse(ws.GetInfoByZIP (txtZip.Text).ToString());  
foreach (XElement xe in Results.Elements("NewDataSet").Elements("Table").Descendants()) 
{ 
if (xe.Name == "CITY") 
{ 
txtCity.Text = xe.Value; 
} 
if (xe.Name == "STATE") 
{ txtState.Text = xe.Value; 
} 
} 
} 


Is there an issue with the XML being returned? I wasn't sure what the - signs were for.

Thank you, WHEELS
AnswerRe: C# VS 2008 3.5 XML/Webservice error Pin
#realJSOP23-Apr-10 6:54
professional#realJSOP23-Apr-10 6:54 
GeneralRe: C# VS 2008 3.5 XML/Webservice error Pin
Wheels01223-Apr-10 7:13
Wheels01223-Apr-10 7:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.