DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: XML to text Boxes

  1. #1
    Join Date
    Feb 2011

    Question XML to text Boxes

    I need to take my XML data to populate text boxes

    this is what I have.

    ProjectReferralTableControlRow rows = new ProjectReferralTableControlRow();
                    XmlTextReader obj = new XmlTextReader(@"c:\temp\reg.xml");
                    string sr= "";
                        switch (obj.NodeType)
                            case XmlNodeType.Element:
                                sr = obj.Name;
                                    case XmlNodeType.Text:
                                           //this.SubConstructionManagerLabel1.Text = obj.GetAttribute("BusinessName");
                                           rows.SubConstructionManager1.Text = obj.GetAttribute("BusinessName");
                                           rows.SubContactName1.Text = obj.GetAttribute("OwnerName");
                                           rows.SubAddress1.Text = obj.GetAttribute("Address");
                                          // break;
                                           rows.SubCity1.Text = obj.GetAttribute("City");
                                           rows.SubState1.Text = obj.GetAttribute("State");
                                          // break;
                                           rows.SubZip1.Text = obj.GetAttribute("ZipCode");
                                          // break;
                                           rows.SubPhone1.Text = obj.GetAttribute("Phone");
                                          // break;
                                           rows.SubFax1.Text = obj.GetAttribute("Fax");
                                           rows.SubEmail1.Text = obj.GetAttribute("Email");
    I am using a table control and repeaters so if I can get this to work.

    I can figure out the rest.

    My XML file read like this.

    <?xml version="1.0" encoding="utf-8"?><Registration><BusinessName>North Coast Minority Media, LLC</BusinessName><OwnerName>Louis A. Acosta</OwnerName><Address>2310 Superior Avenue, Suite 260</Address><City>Cleveland</City><State>Ohio</State><ZipCode>44114</ZipCode><Phone>4402420835</Phone><Fax>&amp;nbsp;</Fax><EmailAddress></EmailAddress><BusinessName>Bernard R. Doyle dba FASTSIGNS</BusinessName><OwnerName>Mary C. and Bernard Doyle</OwnerName><Address>2102 St. Clair Avenue</Address><City>Cleveland</City><State>Ohio</State><ZipCode>44114</ZipCode><Phone>2165232288</Phone><Fax>2165231265</Fax><EmailAddress></EmailAddress><BusinessName>DLR Protection</BusinessName><OwnerName>Darren Robinson</OwnerName><Address>16919 Invermere Avenue</Address><City>Cleveland</City><State>Ohio</State><ZipCode>44128</ZipCode><Phone>2169916018</Phone><Fax>2169916085</Fax><EmailAddress></EmailAddress></Registration>

  2. #2
    Join Date
    May 2009
    read this

    in your xml file is no attribut

    better make a new xml
    <?xml version="1.0" encoding="utf-8"?>
    		<BusinessName>North Coast Minority Media, LLC</BusinessName>
    		<OwnerName>Louis A. Acosta</OwnerName>
    		<Address>2310 Superior Avenue, Suite 260</Address>
    		<BusinessName>Bernard R. Doyle dba FASTSIGNS</BusinessName>
    		<OwnerName>Mary C. and Bernard Doyle</OwnerName>
    		<Address>2102 St. Clair Avenue</Address>
    		<BusinessName>DLR Protection</BusinessName>
    		<OwnerName>Darren Robinson</OwnerName>
    		<Address>16919 Invermere Avenue</Address>
    your program must search item
    and then read all node in this node

Similar Threads

  1. XML Startkabel Updates
    By xmlstartkabel in forum XML
    Replies: 0
    Last Post: 10-10-2001, 04:07 AM
  2. Replies: 0
    Last Post: 10-01-2001, 12:19 PM
  3. Script for scrolling
    By Mark in forum Web
    Replies: 3
    Last Post: 08-30-2001, 11:45 AM
  4. XML tutorials - fyi
    By Jeff Condon in forum XML
    Replies: 0
    Last Post: 05-29-2001, 02:25 PM
  5. XML Security
    By HSIN NING in forum Web
    Replies: 0
    Last Post: 08-21-2000, 12:21 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center