Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB8.0
Hi,
 
I have figured out how to do pretty much everything with DataSets in VB8. I just can't for the life of me figure out how to return the data contained in specified table, row and column. I’m sure the answer is really simple.
 
Please Help
 
Marco
Posted 14-Jul-10 21:27pm

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Yes it is simple.
 
As you say you have pretty much figured out *everything* about DataSet, then Datatable row/column access would be easy for you.
As:
Dataset is a collection of tables (one or more).
 
C#:
myDataSet.Tables[0].Rows //0 for first table.
myDataSet.Tables[0].Columns //0 for first table
 
VB:
myDataSet.Tables(0).Rows
myDataSet.Tables(0).Columns
 
This should get you going.
 
Read all about the Dataset and tables in VB here: The Tables of a Data Set[^]
  Permalink  
v2
Comments
bigbro_1985 at 15-Jul-10 3:11am
   
Hi,
 
Thanks for the Quick response.
 
I used:
AccommodationDataSet.Tables[0].rows
AccommodationDataSet.Tables[0].columns
 
on "[0]" I get "Identifier Expected"
and there is no Rows or Columns properties available under the property Tables.
 
I'm using VB8, are you using C?
Sandeep Mewara at 15-Jul-10 3:19am
   
Updated answer with VB sample and a link that would help you in learning all about datatables n dataset.
bigbro_1985 at 15-Jul-10 3:33am
   
Reason for my vote of 5
Quick Response, Perfect Answer!
bigbro_1985 at 15-Jul-10 3:37am
   
Thanks!
 
I did this:
Label2.Text = AccommodationDataSet.Tables(0).Rows(1).Item("AFloor")
 
Got it to work, and it was really simple! I really deserve a boot to the head!
 
Thanks Again
Sandeep Mewara at 15-Jul-10 3:38am
   
:) no issues. It happens.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web03 | 2.8.1411022.1 | Last Updated 15 Jul 2010
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100