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

Is it possible to use two versions of assembly at the same time?If possible explain with code?

3 Answers   Tech Mahindra,


What is the question mark in a url?

0 Answers  


What are validator? Name the Validation controls in asp.net? How do u disable them?

2 Answers  


What is the difference between session and application?

0 Answers  


Diff B/W user control and server control

3 Answers  






How you can use video conferencing in asp.net? guys plz help me ...

2 Answers  


We have 2 sites in which one site allows the user with out asking credentials and second one ask for credentials through a log page. What might be the configurations settings for both sites? We can use IIS and web.config files together.

1 Answers   ADITI,


Difference between mvc2 and mvc3 in asp.net?

4 Answers   Wipro,


How to retrieve the information from datatable citywise in c#?

2 Answers   HCL,


hi i am varinder. i am very eager to learn ASP.net in C#. i am beginer to it. i have refer some books but i found it tuff to understand. their language is tuff. So please tell me the best site or best book to learn ASP.net in C#. i will be very thankful. Varinder

1 Answers  


What is view state and how this can be done and was this there in asp?

11 Answers   Accenture, KDOT, Mphasis,


Types of caching. How to implement caching?

2 Answers   Microsoft,


Categories