Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / February 2006

Tip: Looking for answers? Try searching our database.

how to create reader from data set

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jon   Paal - 19 Feb 2006 20:03 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.