I have a dataset created from an xml file
how can I create a datareader (dataview ?) ?? to return sql results
===========
Dim ds As New DataSet()
Dim sr As New StringReader(my_xmlData)
ds.ReadXml(sr)
'query the dataset
'----------------------------
Dim sql As string = "Select [bla bla] From [bla bla] Where [bla bla]"
'
' ------what goes here to create datareader (dataview ?) ???????
'
'check for existence of records
'-------------------------------------------
Dim dr As System.Object
dr= myCommand.ExecuteReader()
if dr.HasRows then
While dr.read
'retrieve data
'bla bla bla.....
End While
end if
Elton W - 19 Feb 2006 20:48 GMT
Hi Jon,
You can loop thru datatable in dataset to get data:
If ds.Tables(0).Rows.Count > 0 Then
For Each row As DataRow In ds.Tables(0).Rows
Dim data1 As String = row(col_index1).ToString
Dim data2 As Integer = CType(row(col_index2), Integer)
' ....
Next
End If
HTH
Elton Wang
> I have a dataset created from an xml file
> how can I create a datareader (dataview ?) ?? to return sql results
[quoted text clipped - 25 lines]
> End While
> end if