Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XML
|
XML General XML discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XML section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 22nd, 2010, 09:03 PM
Authorized User
 
Join Date: Jan 2010
Posts: 33
Thanks: 13
Thanked 0 Times in 0 Posts
Default XML datareader

Hi,

Within .NET Framework there is System.Data.SqlClient namespace and within
that there is SqlDataReader object that has a read method. As shown in the
code this read method can read in desired dataset and store it in a control
and display it. Instead of SQL Server data I am dealing with XML data file
and with XSL formatter and would like to know a compable way of reading in
desired XML data or nodes. Thanks

-----SQLreader--------

Dim MyConnection As SqlConnection
Dim MyCommand As SqlCommand
Dim MyReader As SqlDataReader
Dim CT1 As String
Dim CaseTrackConnectionString As String
CaseTrackConnectionString =
ConfigurationManager.ConnectionStrings("Collection ConnectionString").ConnectionString
MyConnection = New SqlConnection(CaseTrackConnectionString)
MyCommand = New SqlCommand
CT1 = "SELECT * FROM Driver WHERE DriverID='" +
DriverDropDownList.SelectedValue.ToString + "'"
MyCommand.CommandText = CT1
MyCommand.CommandType = CommandType.Text
MyCommand.Connection = MyConnection
MyCommand.Connection.Open()
MyReader = MyCommand.ExecuteReader(CommandBehavior.CloseConne ction)
While MyReader.Read()
If MyReader("DriverMobile") IsNot System.DBNull.Value Then
DriverMobileLabel.Text = MyReader("DriverMobile")
EndIf

EndWhile





Similar Threads
Thread Thread Starter Forum Replies Last Post
datareader in c# ryan.thomson C# 6 June 30th, 2009 12:48 AM
Help with C# DataReader julius ASP.NET 2.0 Basics 9 March 8th, 2009 10:26 PM
DataReader from XML VictorMk Classic ASP XML 0 April 4th, 2005 11:09 AM
DataReader cjcd BOOK: Beginning ASP.NET 1.0 2 March 21st, 2004 01:06 PM
Using DataReader() aadz5 ASP.NET 1.0 and 1.1 Basics 12 November 21st, 2003 06:32 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.