Home All Groups Group Topic Archive Search About
Author
20 Mar 2006 6:20 PM
phonl
I'm new to ADO2.net.  This must be easy, but how would I do get this value
in ADO2.net?

VB6 ADO:
msgbox myRecordset!myField

In ADO2.net I have a TableAdapter, DataSet, and BindingSource binding data
to controls.  I want to get the value of "myField" in vb.net 2005 code.

Author
21 Mar 2006 1:58 AM
Kevin Yu [MSFT]
Hi phonl,

To get the myField value, you can get from DataSet directly. DataSet is a
collection of tables. For example, the myField is in the first table, we
can use the following to get the myField value in first row.

MessageBox.Show(Dataset1.Tables[0].Rows[0]["myField"]);

HTH

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
Author
21 Mar 2006 6:27 AM
MS MVP ³sÀA¶¯ for VB.NET
Dear Phonl,

If you propose is only displaying the data, you may also use dataReader.

U may use dataReader1.read and then dataReader1.getValue(column_index)
to get the value.


--
Hope this help and welcome to reply the testing result.

Regards
Ken Lin, Kam Hung
Founder and VP of Hong Kong .NET User Group(http://HKNetUG.com)
MCP, MCP+I, MCDST, MCSA, MCSE(NT4 & win2k),
MCSE+I, MCDBA(SQL7 & SQL2K), MCSD(VB6 & .NET), MCAD(.NET)
Microsoft Community Star(Hong Kong & Taiwan)
Microsoft Most Valuable Professional(.NET since 2003)
MCT2004 & 2005

Show quoteHide quote
"Kevin Yu [MSFT]" <v-k***@online.microsoft.com> wrote in message
news:azgwwrITGHA.6492@TK2MSFTNGXA03.phx.gbl...
> Hi phonl,
>
> To get the myField value, you can get from DataSet directly. DataSet is a
> collection of tables. For example, the myField is in the first table, we
> can use the following to get the myField value in first row.
>
> MessageBox.Show(Dataset1.Tables[0].Rows[0]["myField"]);
>
> HTH
>
> Kevin Yu
> =======
> "This posting is provided "AS IS" with no warranties, and confers no
> rights."
>