Victor Charles
asked on
Help with with exporting data from Datatable to xml using VB.NET
Hi,
How do I modify the code below to export the data from the data table XML?
Thanks,
Victor
How do I modify the code below to export the data from the data table XML?
Dim GGB As String
GGB = "'" & ComboBox2.SelectedItem & "'"
Dim SearchCriteriaZ As String = "COUNTRY IN (" & GGB & ")"
xmlPath1 = System.IO.Path.Combine(Application.StartupPath + "\AOP40.xml") 'grid1
dtsetcol1.Clear()
dtsetcol1.ReadXml(xmlPath1)
Dim FilteredDTA As DataTable
Dim DVA As New DataView(dtsetcol1.Tables(0), SearchCriteriaZ, Nothing, DataViewRowState.CurrentRows)
DVA.Sort = "SN"
FilteredDTA = DVA.ToTable
Me.C1Screen1.DataSource = FilteredDTA
Thanks,
Victor
ASKER
Hi,
I tried it but it didn't work. Seem to work from a dataset but not a table, is there away to convert the data table to a dataset to use the code.
Victor
I tried it but it didn't work. Seem to work from a dataset but not a table, is there away to convert the data table to a dataset to use the code.
Victor
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Are you still programming for framework 1.0 or 1.1
WriteXML was not supported on a DataTable in these versions, but has been since 2.0 (Visual Studio 2005).
If you are still on an old version, do yourself a favor and move to a newer version of Visual Studio and the framework. You can have the Express version for free if you program only from time to time, but if you are a professional and work in a group of 5 programmers or less, you can get the Community Edition, that is a free edition of the Professional.
WriteXML was not supported on a DataTable in these versions, but has been since 2.0 (Visual Studio 2005).
If you are still on an old version, do yourself a favor and move to a newer version of Visual Studio and the framework. You can have the Express version for free if you program only from time to time, but if you are a professional and work in a group of 5 programmers or less, you can get the Community Edition, that is a free edition of the Professional.
ASKER
Hi, I'm using Framework 4.0, code from previous post works.
Thanks.
Thanks.
ASKER
Thank You.
Open in new window