User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the C# section within the Software Development category of DaniWeb, a massive community of 361,584 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,031 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C# advertiser:
Views: 3034 | Replies: 3
Reply
Join Date: Dec 2007
Posts: 3
Reputation: yemen2007 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
yemen2007 yemen2007 is offline Offline
Newbie Poster

Help read xml file and display to many text box

  #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
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Oct 2007
Posts: 92
Reputation: Jugortha is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 8
Jugortha Jugortha is offline Offline
Junior Poster in Training

Re: read xml file and display to many text box

  #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  
Join Date: Dec 2007
Posts: 3
Reputation: yemen2007 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
yemen2007 yemen2007 is offline Offline
Newbie Poster

Re: read xml file and display to many text box

  #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  
Join Date: Dec 2007
Posts: 3
Reputation: yemen2007 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
yemen2007 yemen2007 is offline Offline
Newbie Poster

Re: read xml file and display to many text box

  #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  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb C# Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the C# Forum

All times are GMT -4. The time now is 4:05 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC