Hi this is the coding for adding data in to an xml table
i want the coding for update and delete
Try

Dim emp_xml_doc As New XmlDocument
If
System.IO.File.Exists(Server.MapPath("emp.xml")) Then
emp_xml_doc.Load(Server.MapPath("emp.xml"))
Dim myrow_element As XmlElement
myrow_element =
emp_xml_doc.CreateElement("EmpDetails")
Dim str As String
str = "<EmpID>" & TxtEmpId.Text & "</EmpID>" & _
"<Empname>" & TxtName.Text & "</Empname>" & _
"<EmpSalary>" & TxtSalary.Text & "</EmpSalary>"

myrow_element.InnerXml = str

emp_xml_doc.DocumentElement.AppendChild(myrow_element)
emp_xml_doc.Save(Server.MapPath("emp.xml"))
Response.Write("Record Saved")
Dim ds As New DataSet
ds.ReadXml(Server.MapPath("emp.xml"))
GridView1.DataSource = ds
GridView1.DataBind()

Else
Response.Write("File does not exist.")
End If

Catch ex As Exception
Response.Write(ex.ToString)

End Try


***********************
this is the xml file
<?xml version="1.0" encoding="utf-8" ?>
<Employee>
<empdetails>
<empid>100</empid>
<empname>xxx</empname>
<empsalary>2000</empsalary>
</empdetails>
<EmpDetails>
<EmpID>yyy</EmpID>
<Empname>dddd</Empname>
<EmpSalary>77777</EmpSalary>
</EmpDetails>
<EmpDetails>
<EmpID>rrrr</EmpID>
<Empname>rrrr</Empname>
<EmpSalary>6666</EmpSalary>
</EmpDetails>
<EmpDetails>
<EmpID>qaqa</EmpID>
<Empname>sini</Empname>
<EmpSalary>50000</EmpSalary>
</EmpDetails>
<EmpDetails>
<EmpID>errrrrrrrr</EmpID>
<Empname>rrrrrrrrr</Empname>
<EmpSalary>677777</EmpSalary>
</EmpDetails>
<EmpDetails>
<EmpID>rrr</EmpID>
<Empname>rrr</Empname>
<EmpSalary>33</EmpSalary>
</EmpDetails>
</Employee>


No Answer is Posted For this Question
Be the First to Post Answer

Post New Answer

More ASP.NET Interview Questions

What is globalization and localization in asp net?

0 Answers  


What does WSDL stand for?

10 Answers   Siebel Systems,


What is owin authentication?

0 Answers  


Can we use the java script code in .Net Code behind?

5 Answers   eXensys,


What is .Net3.0 and .Net3.5? Describe something about that Features..

1 Answers  


What was the difference between machine.config and web.config files

17 Answers   Assurgent, NIIT, TCS,


Best Institute in india for online training (Dotnet/java/Tibco/Dwh/etc.....)

4 Answers  


When a dropdownlist has been added by some records and it has been binded why it is not executing i'm facing this error pls help me ? if (is!pageposback) { arraylist books = new arraylist; books.add ("gone with the wind"); books.add ("rahulsriramprakash"); books.add ("vishal"); dropdowndisplay.datasource=books; dropdowndisplay.databind(); } The error is : 1) The dropdowndisplay does not exist.

5 Answers   Netsweeper,


how to stop cookie in particular page using asp.net

2 Answers   CGI,


what are the different ASP.NET Application Folders?

1 Answers   Wipro,


Explain the difference between array and linkedlist?

0 Answers  


What are the events in a page life cycle?

0 Answers  


Categories