read xml file and display to many text box

Please support our C# advertiser: Intel Parallel Studio Home
Reply

Join Date: Dec 2007
Posts: 3
Reputation: yemen2007 is an unknown quantity at this point 
Solved Threads: 0
yemen2007 yemen2007 is offline Offline
Newbie Poster

read xml file and display to many text box

 
0
  #1
Dec 14th, 2007
hi

Dear Friend

i an the new member. i have problem in the xml file. my idea for project write to xml file and read the xml file and display to many the textBox. could you help me.i want display each value to sprat textBox..i want only for the read
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 172
Reputation: Jugortha is an unknown quantity at this point 
Solved Threads: 16
Jugortha Jugortha is offline Offline
Junior Poster

Re: read xml file and display to many text box

 
0
  #2
Dec 14th, 2007
Your question is not very determined
If you want to write/read data from an xml file

add this namespace using System.Data to your project then create a new DataSet

DataSet myDataSet = new DataSet();

then:

to write data within an xml file use
string filePath = @"put your file path here";
myDataSet.WriteXml(filePath);


add this namespace using System.Data to your project then create a new DataSet

DataSet myDataSet = new DataSet();

then:

to read data from an xml file use
string filePath = @"put your file path here";
myDataSet.ReadXml(filePath);
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 3
Reputation: yemen2007 is an unknown quantity at this point 
Solved Threads: 0
yemen2007 yemen2007 is offline Offline
Newbie Poster

Re: read xml file and display to many text box

 
0
  #3
Dec 15th, 2007
HI

want say thanks cause you reply. The I done the part for write xml bout the problem is I want read the xml file and display inn the many text box. I want show me or explain for me how I can display the data inside xml file to the text box.
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 3
Reputation: yemen2007 is an unknown quantity at this point 
Solved Threads: 0
yemen2007 yemen2007 is offline Offline
Newbie Poster

Re: read xml file and display to many text box

 
0
  #4
Dec 17th, 2007
hi
i done this code bout steel have problem can not diplay it in the text box

try
{
string sStartupPath = Application.StartupPath;

XmlTextReader obj =
new XmlTextReader(sStartupPath + @"selected.xml");
string sName = "";
while (obj.Read())
{
switch (obj.NodeType)
{
case XmlNodeType.Element:
sName = obj.Name;
break;
case XmlNodeType.Text:
switch (sName)
{
case "SiteName":
textBox1.Text = obj.GetAttribute("SiteName");
break;
case "WebmasterName":
textBox2.Text = obj.GetAttribute("WebmasterName");
break;
case "WebmasterEmail":
textBox3.Text = obj.GetAttribute("WebmasterEmail");
break;
case "NumberPages":
comboBox1.Text = obj.GetAttribute("NumberPages");
break;
case "FristTemplate":
radioButton1.Text = obj.GetAttribute("FristTemplate");
break;
case "SecondTemplate":
radioButton2.Text = obj.GetAttribute("SecondTemplate");
break;
}
break;
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
}
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C# Forum
Thread Tools Search this Thread



Tag cloud for C#
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC