Wrox Programmer Forums
|
BOOK: Beginning VB.NET Databases
This is the forum to discuss the Wrox book Beginning VB.NET Databases by Thearon Willis; ISBN: 9780764568008
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning VB.NET 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 May 17th, 2005, 03:20 PM
Authorized User
 
Join Date: Feb 2005
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default Dataset to Array

Hello all,

I have a situation where my application pulls data from a text file. The data I am concerned about is locations(Cubicles, Offices, Hallways etc). The application needs to determine from the locations barcode where the locations are located within 3 Sites, 10 Buildings and up to 15 Departments. For instance I use the locations barcode, in a variable (strArea) and use that to determine the 3 items I need to determine:

Code:
If strArea >= objInventory.Buildings(0, 1) And strArea <= objInventory.Buildings(0, 2) Then
            strBuilding = "6"


My question concerns the "ranges" and how to

1.store them
2.allow the user to change them
3.pull the values from where I have stored them and use them in my application

I have implemented 3 methods for these and run into brick walls on all. I have stored the values in 3 tables in an Access DB and have no problem allowing the users to change the values with stored procedures but I am at a loss as to how to pull those values back without having to have a seperate SP for each possibility.

I have stored the values in an XML standalone document and have the same problem as with the database - how to pull individual values from the xml doc so that I can say something like

Code:
If strArea >= strFirstBldg And strArea <= strLastBldg Then
            strBuilding = "6"


And finally I have stored the values in 3 arrays which result in the code above - I can easily run if then statements based on positions in an array. The problem with this one is that I don't know how to allow the user to change the values in the array at run time.

Code:
Public Sites(,) As String = {{1, "HLL00026", "HLL00032"}, _
                                {2, "HLL00033", "HLL00058"}, _
                                {3, 0, 0}, _
                                {4, 0, 0}, _
                                {5, 0, 0}}


Any advice on these problems would be appreciated.

I think the final piece to bring all of this together would be to use a dataset from the database to fill a 2-dimensional array. Is that possible? I have googled and searched on MSDN and can find no mention of it.

Chuck


PS still learning a lot from the book!






 
Old May 18th, 2005, 02:23 AM
Authorized User
 
Join Date: Feb 2005
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello again,

Never mind, I've spent all evening learning about XML - .SelectSingleNode, XPath, etc. to return single values from an XML document.

Chuck








Similar Threads
Thread Thread Starter Forum Replies Last Post
Go from 2d Array to 1d array without defining type OneQuestion General .NET 1 January 10th, 2008 11:13 AM
Converting a untyped dataset to a typed dataset daphnean Visual Studio 2005 0 July 13th, 2006 01:16 AM
Passing php array values to javascript array gkrishna Pro PHP 0 November 6th, 2004 03:20 AM
Re: SQL Server dataset to ACCESS dataset dazzer ADO.NET 0 March 22nd, 2004 05:28 AM





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