New to ADO2.net

P

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.
 
K

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."
 
M

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top