473,378 Members | 1,377 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

how to create reader from data set

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
Feb 19 '06 #1
1 1219
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

"Jon Paal" wrote:
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

Feb 19 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: dog | last post by:
I've seen plenty of articles on this topic but none of them have been able to solve my problem. I am working with an Access 97 database on an NT4.0 machine, which has many Access reports. I...
2
by: Anthony Boudouvas | last post by:
Hi to all, i am just try to send emails in a timer-loop fashion, using the code below and i get the following error message: Could not create 'CDONTS.NewMail' The problem is not happening...
4
by: Ram | last post by:
I am using ADO.Net data reader to retrieve data from main frame. I am getting timestamp which is 26 (yyyy-mm-dd hh- mm-ss.123456) bytes as sqltimestamp data type. I am using data reader to...
6
by: Karl Seguin [MVP] | last post by:
The BinaryWriter/Reader's are little-endian only. Was hoping they were going to be made more flexible in 2.0, but that doesn't appear to be the case. Anyone already done all the work of...
17
by: Philip Wagenaar | last post by:
I have an excel sheet that has several lines. Each line is an order. Example: 1 Paper 10 2 Pencils 20 etc... When the excel sheet is filled out I want the user to press a...
5
by: Michael Sperlle | last post by:
Is it possible? Bestcrypt can supposedly be set up on linux, but it seems to need changes to the kernel before it can be installed, and I have no intention of going through whatever hell that would...
6
by: dgleeson3 | last post by:
Hello All I have VB code (.Net 2005) reading from an SQL server 2005 database. Im getting InvalidCastException when doing reader.GetInt32(0) Im simply reading an int from a simple database. It...
3
by: creative1 | last post by:
Here is how you create a complex data report that involves parent and child commands and you can update information at runtime. Its pretty straight forward to work with simple queries; however,...
1
by: TG | last post by:
Hi! I have an application in which I have some checkboxes and depending which ones are checked those columns will show in the datagridview from sql server or no. After that I have 2 buttons:...
0
by: bill | last post by:
Can someone please show me what to do with this to show the data in a dataGrid for example? I'm not really sure what to do with it. I'm used to Vb6. Dim Con = New...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.