Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Beginning VB 6
|
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 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 March 15th, 2007, 10:58 PM
Registered User
 
Join Date: Mar 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi lowell,
there is another way to acheive your goal, that involves also the "Reflection"... It has to be used with a strongly typed xml. It means that the xml must include the dataset structure. But it works fine and with nice performances.

At the top of the class you create you have to implement this:
Imports System.Reflection
Imports System.IO

First: you have to define and instanciate a new dataset
Dim oDS As New DataSet()

Second: use the IO.Stream to load the structure and the data of the xml file
Dim oStream As IO.Stream = [Assembly].GetExecutingAssembly.GetManifestResourceStream("< root Namespace>.Employees.xml")
The root namespace is a parameter of the project setted in the project property tab. In .NET 2003 go on the "Solution Explorer" right click the project name and choose "Properties".

green]Third: now use the XmlTextReader to read the stream
Dim oReader As New Xml.XmlTextReader(oStream)

Fourth: using the ReadXml od the dataset load the data and the structure into the dataset[/green]
oDS.ReadXml(oReader)

Once you have done theese few steps you could use a DataView to implement filtering on the data.










Similar Threads
Thread Thread Starter Forum Replies Last Post
Conditional Resources Jose Silva Visual Studio 2005 0 March 16th, 2008 04:55 PM
Retrieving strings in sequence lowell VB.NET 1 March 8th, 2007 06:31 PM
Resources mike72 ASP.NET 2.0 Professional 0 January 3rd, 2006 08:25 AM
Cleaning up resources jbenson001 ASP.NET 1.x and 2.0 Application Design 2 January 22nd, 2004 11:50 AM
Resources vijay VB.NET 2002/2003 Basics 2 November 3rd, 2003 11:25 AM





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