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

Can we use http handlers to upload a file in asp.net?

2 Answers  


Where code pages are used?

0 Answers   Blue Star,


You have two buttons in web form and i clicked on one of the button, so how do i find which button i've clicked on the form in my page load?

15 Answers   INDUS,


what is webservices. howit is use in our project .

4 Answers   TCS,


Every Validation controls have same option ?

2 Answers   iGate,






Below is a code extract from an ASP.Net application. The code basically reads data from the “name” field in the “members” table and prints them onto the webpage. Using the assumptions provided, fill in the 4 blanks below so that the code will run correctly. ‘Assumptions: ‘conn_str is a variable that holds the connection string to the database ‘Objects dbcomm and dbread are already declared earlier dbcomm = New OleDbCommand("SELECT name FROM members", conn_str) dbread = dbcomm._______________ _____________________ response.write(_______________) _____________________ dbread.Close()

4 Answers   Techno Solutions,


Define asp.net caching?

0 Answers  


Where do you store the information about the user?s locale?

1 Answers  


Difference between datareader and dataset ?

4 Answers   Microsoft,


How to use class library reference in asp.net project? Can you give me the example with source Class library haves classes like Database, insert, update, delete, reflection how can i use the database class connection in insert class to insert the record in to the Main Project in asp.net.

1 Answers  


Can a user browsing my Web site read my Web.config or Global.asax files ?

1 Answers  


Explain the life cycle of an ASP .NET page

2 Answers   HCL, Surya Software,


Categories