Re: How to get Number of columns in a dataset by tshad
tshad
Thu Sep 01 11:18:16 CDT 2005
"Marina" <someone@nospam.com> wrote in message
news:uCVFLowrFHA.4040@TK2MSFTNGP14.phx.gbl...
> My example was for getting the columns from the first table in a dataset.
>
> Cor was correctin that a dataset is just a collection of tables. It has
> no columns as such.
>
> If you were talking about a database for example, you wouldn't say that a
> database has column. A database has tables. And those tables are the
> things that have columns.
>
> Same idea here.
That makes sense.
The Dataset is a level above DataTables.
Thanks,
Tom
>
> "tshad" <tscheiderich@ftsolutions.com> wrote in message
> news:%23c%23VfewrFHA.3060@TK2MSFTNGP09.phx.gbl...
>> "Cor Ligthert [MVP]" <notmyfirstname@planet.nl> wrote in message
>> news:eYWePXsrFHA.3264@TK2MSFTNGP12.phx.gbl...
>>> Thad,
>>>
>>> Just for the record, don't mix up a dataset with a recordset.
>>>
>>> A dataset contains no columns. The only items it has are datatables,
>>> relations, keys etc. about that.
>>
>> That may be true but you use "Columns" to find the names and number of
>> "Columns" in the Dataset - don't you?
>>
>> As Marina pointed out:
>>
>> count:
>> myDataSet.Tables(0).Columns.Count
>>
>> column name:
>> myDataSet.Tables(0).Columns(colIndex).ColumnName
>>
>> Thanks,
>>
>> Tom
>>>
>>> Just as addition.
>>>
>>> Cor
>>>
>>
>>
>
>