Hai there,
Now im doing to display data in XML file to many textbox..
Can anyone show me how to do that..Thanks
Here i give u the sample XML file:

<ClearanceLogItem>
  <RecordID>C73B5191-C426-4306-8FDE-26D41773C895</RecordID>
  <TxnTimestamp>20100324154140</TxnTimestamp>
  <SiteID>1708</SiteID>
  <ClientID>MAG02</ClientID>
  <MoveType>1</MoveType>
  <TxnStatus>0</TxnStatus>
  <FailureType>4</FailureType>
  <WLStatus>0</WLStatus>
  <DocType />
  <DocNo />
  <BearerName />
  <DOB />
  <DOE />
  <Nationality />
  <Gender />
  <ErrorMessage><![CDATA[Certificate chaining & revoke check fail.]]></ErrorMessage>
  <UserID />
</ClearanceLogItem>
<ClearanceLogItem>
  <RecordID>896D53A6-4172-4036-8B7C-7A4F1DA44A30</RecordID>
  <TxnTimestamp>20100324154200</TxnTimestamp>
  <SiteID>1708</SiteID>
  <ClientID>MAG02</ClientID>
  <MoveType>1</MoveType>
  <TxnStatus>0</TxnStatus>
  <FailureType>4</FailureType>
  <WLStatus>0</WLStatus>
  <DocType />
  <DocNo />
  <BearerName />
  <DOB />
  <DOE />
  <Nationality />
  <Gender />
  <ErrorMessage><![CDATA[Certificate chaining & revoke check fail.]]></ErrorMessage>
  <UserID />
</ClearanceLogItem>

sory..Here the complete XML file:

<ClearanceLogItem>
  <RecordID>14F60621-D62D-4B78-B339-33CE0C590A6D</RecordID>
  <TxnTimestamp>20100319170249</TxnTimestamp>
  <SiteID>1708</SiteID>
  <ClientID>KAG02</ClientID>
  <MoveType>2</MoveType>
  <TxnStatus>1</TxnStatus>
  <FailureType>0</FailureType>
  <WLStatus>0</WLStatus>
  <DocType>101</DocType>
  <DocNo>88888888</DocNo>
  <BearerName><![CDATA[SHAHFINAZ BINTI MOHD RADZI]]></BearerName>
  <DOB>19810610</DOB>
  <DOE>20110718</DOE>
  <Nationality />
  <Gender>F</Gender>
  <ErrorMessage />
  <UserID />
</ClearanceLogItem>
<ClearanceLogItem>
  <RecordID>47DE02DC-CA23-4D6A-A31D-4BA398CF79FA</RecordID>
  <TxnTimestamp>20100319171356</TxnTimestamp>
  <SiteID>1708</SiteID>
  <ClientID>KAG02</ClientID>
  <MoveType>2</MoveType>
  <TxnStatus>1</TxnStatus>
  <FailureType>0</FailureType>
  <WLStatus>0</WLStatus>
  <DocType>101</DocType>
  <DocNo>88888888</DocNo>
  <BearerName><![CDATA[SHAHFINAZ BINTI MOHD RADZI]]></BearerName>
  <DOB>19810610</DOB>
  <DOE>20110718</DOE>
  <Nationality />
  <Gender>F</Gender>
  <ErrorMessage />
  <UserID />
</ClearanceLogItem>

Looks pretty straightforward. What's the problem exactly?

Actly,my background not from IT site.I meant not a developer..
So, im new in this field.Then, hope u can help me..

This is my coding to display that data:

private void button1_Click(object sender, EventArgs e)
        {
            pictureBox1.ImageLocation = "pic.bmp"; 

            XDocument xmlDoc = XDocument.Load("Log_MAG02.20100520.xml"); 

            var ClearanceLogItems = from ClearanceLogItem in xmlDoc.Descendants("ClearanceLogItem") //Person
                select new
                {
                    RecordID = ClearanceLogItem.Element("RecordID").Value,
                    TxnTimestamp = ClearanceLogItem.Element("TxnTimestamp").Value,
                    SiteID = ClearanceLogItem.Element("SiteID").Value,
                    ClientID = ClearanceLogItem.Element("ClientID").Value,
                    MoveType = ClearanceLogItem.Element("MoveType").Value,
                    TxnStatus = ClearanceLogItem.Element("TxnStatus").Value,
                    FailureType = ClearanceLogItem.Element("FailureType").Value,
                    WLStatus = ClearanceLogItem.Element("WLStatus").Value,
                    DocNo = ClearanceLogItem.Element("DocNo").Value,
                    DocType = ClearanceLogItem.Element("DocType").Value,
                    BearerName = ClearanceLogItem.Element("BearerName").Value,
                    DOB = ClearanceLogItem.Element("DOB").Value,
                    DOE = ClearanceLogItem.Element("DOE").Value,
                    Nationality = ClearanceLogItem.Element("Nationality").Value,
                    Gender = ClearanceLogItem.Element("Gender").Value,
                };
            
            textBox1.Text = "";
            textBox2.Text = "";
            textBox3.Text = "";
            textBox4.Text = "";
            textBox5.Text = "";
            textBox6.Text = "";
            richTextBox1.Text = "";
            foreach (var ClearanceLogItem in ClearanceLogItems)//var person in persons
            {
                textBox1.Text = ClearanceLogItem.BearerName;
                textBox2.Text = ClearanceLogItem.RecordID;
                textBox3.Text = ClearanceLogItem.DocType;
                textBox4.Text = ClearanceLogItem.DOB;
                textBox5.Text = ClearanceLogItem.Gender;
                textBox6.Text = ClearanceLogItem.DOE;
                richTextBox1.Text = richTextBox1.Text + "RecordID: " + ClearanceLogItem.RecordID + "\n";
                richTextBox1.Text = richTextBox1.Text + "TxnTimestamp: " + ClearanceLogItem.TxnTimestamp + "\n";
                richTextBox1.Text = richTextBox1.Text + "SiteID: " + ClearanceLogItem.SiteID + "\n";
                richTextBox1.Text = richTextBox1.Text + "ClientID: " + ClearanceLogItem.ClientID + "\n";
                richTextBox1.Text = richTextBox1.Text + "MoveType: " + ClearanceLogItem.MoveType + "\n";
                richTextBox1.Text = richTextBox1.Text + "TxnStatus: " + ClearanceLogItem.TxnStatus + "\n";
                richTextBox1.Text = richTextBox1.Text + "FailureType: " + ClearanceLogItem.FailureType + "\n";
                richTextBox1.Text = richTextBox1.Text + "WLStatus: " + ClearanceLogItem.WLStatus + "\n";
                richTextBox1.Text = richTextBox1.Text + "DocType: " + ClearanceLogItem.DocType + "\n";
                richTextBox1.Text = richTextBox1.Text + "DocNo: " + ClearanceLogItem.DocNo + "\n";
                richTextBox1.Text = richTextBox1.Text + "BearerName: " + ClearanceLogItem.BearerName + "\n";
                richTextBox1.Text = richTextBox1.Text + "DOB: " + ClearanceLogItem.DOB + "\n";
                richTextBox1.Text = richTextBox1.Text + "DOE: " + ClearanceLogItem.DOE + "\n";
                richTextBox1.Text = richTextBox1.Text + "Nationality: " + ClearanceLogItem.Nationality + "\n";
                richTextBox1.Text = richTextBox1.Text + "Gender: " + ClearanceLogItem.Gender + "\n\n";
            }
            
            if (richTextBox1.Text == "")
                richTextBox1.Text = "No Results.";
        }

y i cant display the data?
can u help me?TQ

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.