The text of this article is not in this database — only its details are. Read it on the old site: Show the data in to DataGridView from the XML file
7 Comments
Join the conversation! Your thoughts help the community grow.
Sign in to leave a comment.
The text of this article is not in this database — only its details are. Read it on the old site: Show the data in to DataGridView from the XML file
Join the conversation! Your thoughts help the community grow.
Sign in to leave a comment.
Arslan AliPosted May 13, 2010, 12:04 PM
this code is not working. when i put in this code. it creates problem in accessing the xml file.... arslan
Archana RPosted Jan 5, 2010, 9:41 AM
Hi So now the grid is having 3 rows added. now if we need to add one more row from the xml . How do we do that? Could you please guide me in this?
Ankit RathorePosted Dec 21, 2009, 1:21 AM
Hi Guys, My problem is still not solved.... Suppose I have an XML document like:- <EmployeeDetail> <EmployeeID> <EmpId>101</EmpId> <EmpId>202</EmpId> </EmployeeID> <EmployeeName> <EmpName>Jai</EmpName> <EmpName>Anurag</EmpName> </EmployeeName> <EmpAddress> <EmpAdd>Bangalopre</EmpAdd> <EmpAdd>Bangalopre</EmpAdd> </EmpAddress> </EmployeeDetail> And these detail I have to show in DATAGRID......... So please tell me the solution
Ankit RathorePosted Dec 19, 2009, 7:38 AM
Here My format of XM is changed so facing a problem to get appropriate output Please help............ <EmployeeDetail> <EmployeeID> <EmpId>101</EmpId> <EmpId>202</EmpId> </EmployeeID> <EmployeeName> <EmpName>Jai</EmpName> <EmpName>Anurag</EmpName> </EmployeeName> <EmpAddress> <EmpAdd>Bangalopre</EmpAdd> <EmpAdd>Bangalopre</EmpAdd> </EmpAddress> </EmployeeDetail>
Kees de VreugdeditedPosted Mar 21, 2009, 8:42 AMEdited Mar 21, 2009, 8:44 AM
There is a VB version for those asking that does exactly this here: http://www.depopo.net/content/publish/dataaccess/How_to_import_an_XML_file_into_a_datagridview.shtml also copied below, as links tend to disappear :) ' --- Open a filepicker and let the user select a file Dim s_filename As String Dim myopenfiledialog As New OpenFileDialog myopenfiledialog.ShowDialog() s_filename = myopenfiledialog.FileName ' the file selected by the user ' --- Read the content of the xml file Dim myxmldoc As Xml.XmlDataDocument myxmldoc = New Xml.XmlDataDocument myxmldoc.DataSet.ReadXml(s_filename) ' --- Get the data into a dataset Dim mydataset As New DataSet mydataset = myxmldoc.DataSet ' --- And bind it to the datagridview ' Reference the table number by name if you know it, or by number if not DataGridView1.DataSource = mydataset.DefaultViewManager DataGridView1.DataMember = mydataset.Tables(1).ToString
Nate OceanPosted Mar 5, 2009, 3:43 PM
I'd like to see a Visual Basic 2008 Express version. I need to take a table built in Excel and Export it to XML (pretty easy to do from Excel). Then I need to Import the XML file into Visual Basic for various processing. Then I need to Export it back to XML for later processing by a different Visual Basic program. So a compact, clean and efficient way, such as you have show, to both Import AND Export XML into and out of Visual Basic would be great. Thanks for posting this useful code.
Shakil PatelPosted Feb 4, 2009, 5:57 AM
Hi I am a complete beginner to VB2008, and was wondering if anyone could show how to write the same code for VB 2008 Express, If you could let me know that would be good. Shakil