Wrox Programmer Forums
|
BOOK: Beginning XML Databases
This is the forum to discuss the Wrox book Beginning XML Databases by Gavin Powell; ISBN: 9780471791201
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning XML Databases 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:08 PM
Authorized User
 
Join Date: Jan 2010
Posts: 33
Thanks: 13
Thanked 0 Times in 0 Posts
Default XML datareader question

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
XML datareader jtnchang XML 0 January 22nd, 2010 09:03 PM
XML question for you XML Gurus SQLScott SQL Server 2005 1 June 25th, 2008 11:29 AM
Convert XML to XML template question bonekrusher XSLT 3 July 12th, 2007 07:47 AM
convert XML to XMl - Another Namespace question bonekrusher XSLT 2 July 10th, 2007 07:32 AM
DataReader from XML VictorMk Classic ASP XML 0 April 4th, 2005 11:09 AM





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