i need to make a CRUD application using the XML and VB.net. Pls Help me on how to create, write, read, update, delete the data only using XML file and VB.net.
Dim ds As New DataSet()
ds.ReadXml("..\..\Student.xml")
Dim dr As DataRow
dr = ds.Tables("Student").NewRow()
dr("RollNo") = cmbId.Text
dr("Name") = txtName.Text
If rbnPassed.Checked Then
dr("Result") = "Passed"
Else
dr("Result") = "Failed"
End If
ds.Tables("Student").Rows.Add(dr)
ds.WriteXml("..\..\Student.xml")
If I were you I would use LINQ to XML for all of your CRUD operations. The LINQ to XML operations are powerful and will save you a
lot of coding. Take a look to the following for code samples on CRUD (Create = XML Construction, READ = LINQ Query, UPDATE = XML Write, DELETE = DML):
Utsavp
Member
22 Points
55 Posts
XML vb.net
May 10, 2010 12:26 PM|LINK
Hi,
i need to make a CRUD application using the XML and VB.net. Pls Help me on how to create, write, read, update, delete the data only using XML file and VB.net.
:)
adeelehsan
All-Star
18221 Points
2724 Posts
Re: XML vb.net
May 10, 2010 01:33 PM|LINK
Hi
If the XML file structure is not very complex, you can use DataTable to read and update the file programmatically.
For example:
Dim dt as new DataTable()
dt.ReadXML(........)
Then later you can make the modification and save back the xml using:
st.WriteXML(......)
asp .net 2.0
MCPD ASP.NET 4.0 and 3.5, MCTS WSS, MOSS, SharePoint 2010, MCT
Microsoft Community Contributor Award 2011
Vijaya.A
Contributor
2408 Points
629 Posts
Re: XML vb.net
May 11, 2010 07:58 AM|LINK
Hi check this
http://www.c-sharpcorner.com/uploadfile/mahesh/readwritexmltutmellli2111282005041517am/readwritexmltutmellli21.aspx
http://www.codeguru.com/vb/gen/vb_database/adonet/article.php/c5153
http://www.dotnetspider.com/resources/5761-Read-Write-XML-files-using-VB-NET.aspx
http://www.dotnetspider.com/resources/2512-READ-UPDATE-DELETE-XML-FILE-XPATH.aspx
Vijaya.A
Contributor
2408 Points
629 Posts
Re: XML vb.net
May 11, 2010 08:05 AM|LINK
Hi i posted c# links also so for converting C# to vb.net use this link
http://www.developerfusion.com/tools/convert/csharp-to-vb/
pauldaniel
Contributor
2092 Points
342 Posts
Re: XML vb.net
May 11, 2010 10:54 AM|LINK
Hi
Refer this thread
http://www.foxite.com/archives/crud-forms-vbnet-0000154655.htm
http://www.vbdotnetforums.com/general-learning-resources-discussion/37773-visual-basic-book-crud-tutorial.html
http://www.dotcominfoway.com/
Vijaya.A
Contributor
2408 Points
629 Posts
Re: XML vb.net
May 11, 2010 11:03 AM|LINK
Hi check this sample
Dim ds As New DataSet() ds.ReadXml("..\..\Student.xml") Dim dr As DataRow dr = ds.Tables("Student").NewRow() dr("RollNo") = cmbId.Text dr("Name") = txtName.Text If rbnPassed.Checked Then dr("Result") = "Passed" Else dr("Result") = "Failed" End If ds.Tables("Student").Rows.Add(dr) ds.WriteXml("..\..\Student.xml")Utsavp
Member
22 Points
55 Posts
Re: XML vb.net
May 12, 2010 07:25 AM|LINK
Here actually CRUD means : Create Restore Update Delete the Data from XML using vb.net language. Can anybody help
me for how to update the data and sort the data stored in XML file using vb.net.
LynxNet
Member
2 Points
2 Posts
Re: XML vb.net
May 13, 2010 06:43 AM|LINK
Are you looking for sample application?
Omer Rasheed
Utsavp
Member
22 Points
55 Posts
Re: XML vb.net
May 13, 2010 07:30 AM|LINK
ya the application simple and small... but it will be good if all task is done related to XML file.
Regards,
Utsav
atconway
All-Star
16846 Points
2756 Posts
Re: XML vb.net
May 14, 2010 02:42 PM|LINK
If I were you I would use LINQ to XML for all of your CRUD operations. The LINQ to XML operations are powerful and will save you a lot of coding. Take a look to the following for code samples on CRUD (Create = XML Construction, READ = LINQ Query, UPDATE = XML Write, DELETE = DML):
LINQ to XML Samples:
http://msdn.microsoft.com/en-us/vbasic/bb688087.aspx
Hope this helps!