>>What do you need to convert? It is C#? Are you using the Code-behind page? Are you using VB.NET? Are you coding inside of the .ASPX instead of the code-behind? You will need the System.Data, and the System.Xml reference.
>
>Yes, the code is in the aspx page.
>
>I am using VB.NET code.
Oh. Ok. No prob. Well, first I would recommend you putting the code in the code behind to separate the logic and the design, but that is a design decision. Here is the converted VB.NET code.
Public Sub ImportXML(Data As DataSet, XML As String)
Dim sr As New StringReader(XML)
Data.ReadXML(sr, XmlReadMode.InferSchema)
Data.AcceptChanges()
End Sub 'ImportXML
A great webservice to convert from C# to VB.NET is available here.
http://authors.aspalliance.com/aldotnet/examples/translate.aspxTo put it in the .aspx page..
You can put it in the page like this.
<Script Runat="Server">
Sub Page_Load( s As Object, e As EventArgs )
End Sub
Public Sub ImportXML(Data As DataSet, XML As String)
Dim sr As New StringReader(XML)
Data.ReadXML(sr, XmlReadMode.InferSchema)
Data.AcceptChanges()
End Sub 'ImportXML
</Script>
I would recommend putting your code in the code-behind though, check out this.
http://www.c-sharpcorner.com/FreeChapters/SMS/Chap6SeperatingCodeASPNETUnleashed.aspI hope that helps.
Morgan