Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. XML / XSL
  4. how can i create xml data abd how can i update delete and insert..

how can i create xml data abd how can i update delete and insert..

Scheduled Pinned Locked Moved XML / XSL
questioncsharpdatabasexmlannouncement
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Rajeshwar Code Developer
    wrote on last edited by
    #1

    hi everyone ..i m working on one zoo project ..so i need some information .. i want 2 create xml file as a database and i want 2 insert data ,delete data,and update .. in xml database plzz can any one tell how it ll do?? in using C# code..

    thanks 2 all..

    P 1 Reply Last reply
    0
    • R Rajeshwar Code Developer

      hi everyone ..i m working on one zoo project ..so i need some information .. i want 2 create xml file as a database and i want 2 insert data ,delete data,and update .. in xml database plzz can any one tell how it ll do?? in using C# code..

      thanks 2 all..

      P Offline
      P Offline
      Prateek G
      wrote on last edited by
      #2

      Insert and delete are pretty simple methods. U just need to access proper node with the help of Xpath query. Post ur specific question if u have any...

      R 1 Reply Last reply
      0
      • P Prateek G

        Insert and delete are pretty simple methods. U just need to access proper node with the help of Xpath query. Post ur specific question if u have any...

        R Offline
        R Offline
        Rajeshwar Code Developer
        wrote on last edited by
        #3

        can u provide insert and delete code..plz...

        thanks 2 all..

        G 1 Reply Last reply
        0
        • R Rajeshwar Code Developer

          can u provide insert and delete code..plz...

          thanks 2 all..

          G Offline
          G Offline
          George L Jackson
          wrote on last edited by
          #4

          Read the documentation, write your code and, then, ask for help on a specific problem. I provided some links below to get you started: http://msdn2.microsoft.com/en-us/library/0h7a3akd(VS.80).aspx[^] http://msdn2.microsoft.com/en-us/library/etdhs5bz(VS.80).aspx[^] http://msdn2.microsoft.com/en-us/library/1w7dc16f(VS.80).aspx[^]

          "We make a living by what we get, we make a life by what we give." --Winston Churchill

          U 1 Reply Last reply
          0
          • G George L Jackson

            Read the documentation, write your code and, then, ask for help on a specific problem. I provided some links below to get you started: http://msdn2.microsoft.com/en-us/library/0h7a3akd(VS.80).aspx[^] http://msdn2.microsoft.com/en-us/library/etdhs5bz(VS.80).aspx[^] http://msdn2.microsoft.com/en-us/library/1w7dc16f(VS.80).aspx[^]

            "We make a living by what we get, we make a life by what we give." --Winston Churchill

            U Offline
            U Offline
            User 4645177
            wrote on last edited by
            #5

            Check This Out...It will work out... :) Protected Sub GridView1_RowUpdating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GridView1.RowUpdating Dim i As Integer = GridView1.Rows(e.RowIndex).DataItemIndex Dim strId As String = CType(GridView1.Rows(e.RowIndex).Cells(2).Controls(0), TextBox).Text Dim strName As String = CType(GridView1.Rows(e.RowIndex).Cells(3).Controls(0), TextBox).Text GridView1.EditIndex = -1 BindGrid() ' Update the XML file using the new values Dim oDs As Data.DataSet = GridView1.DataSource oDs.Tables(0).Rows(i).Item(0) = strId oDs.Tables(0).Rows(i).Item(1) = strName oDs.WriteXml(Request.PhysicalApplicationPath + "books.xml") BindGrid() End Sub Protected Sub GridView1_RowDeleting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GridView1.RowDeleting BindGrid() Dim oDs As Data.DataSet = GridView1.DataSource oDs.Tables(0).Rows(GridView1.Rows(e.RowIndex).DataItemIndex).Delete() oDs.WriteXml(Request.PhysicalApplicationPath + "books.xml") BindGrid() End Sub Protected Sub GridView1_RowCancelingEdit(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GridView1.RowCancelingEdit GridView1.EditIndex = -1 BindGrid() End Sub Protected Sub GridView1_RowEditing(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GridView1.RowEditing GridView1.EditIndex = e.NewEditIndex BindGrid() End Sub Protected Sub GridView1_PageIndexChanging(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewPageEventArgs) Handles GridView1.PageIndexChanging GridView1.PageIndex = e.NewPageIndex BindGrid() End Sub Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Page.IsPostBack = False Then BindGrid() End If End Sub Sub BindGrid() Dim oDs As New Data.DataSet oDs.ReadXml(Request.PhysicalApplicationPath + "books.xml") GridView1.DataSource = oDs GridView1.DataBind() End Sub Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click If txtId.Text = "" Or txtName.Text = "" Then MsgBox("

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups