Ver Mensaje Individual
  #6 (permalink)  
Antiguo 31/03/2005, 08:09
Avatar de xknown
xknown
 
Fecha de Ingreso: diciembre-2004
Ubicación: Cusco - Perú
Mensajes: 2.248
Antigüedad: 20 años, 2 meses
Puntos: 7
Disculpa por enviarte el código sin probar, como indicaste no existía ningún valor en el Stream cuando se ejecutaba ds.ReadXml, aquí te mando la solución corregida.
Código:
Public Function StrXml2Table(ByVal StrXML As String) As DataTable

	Dim ms As MemoryStream
	Dim buf() as Byte

	Try
		Dim ds As New DataSet
		buf= System.Text.ASCIIEncoding.ASCII.GetBytes(StrXML)
		ms = New MemoryStream(buf)
	   
		ds.ReadXml(ms)

		Return ds.Tables(0)
	Catch ex As Exception
		Throw New Exception("Error en StrXml2Table: " & ex.ToString)
	Finally
		If Not sw Is Nothing Then
			sw.Close()
		End If
		If Not ms Is Nothing Then
			ms.Close()
		End If
	End Try
End Function
Saludos
__________________
Alex Concha
Buayacorp - Programación y Diseño