vb to cSharp conversion

  • Thread starter Thread starter arun
  • Start date Start date
A

arun

Hi
Any one kno what is the C3 equivalent of vb
DataSetObj .Tables(0).Rows(0).Item("ID")

Thanks in Advance
 
Flip the () to [] and add a SemiColor on hte end:

DataSetObj .Tables[0].Rows[0].Item["ID"];


--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com

********************************************
Think outside the box!
********************************************
 
(Sorry for typo error)..

No that is not the correct answer. In c# there is no property Item...
Only Item array is there... that too we cant access like
DataSetObj .Tables(0).Rows(0).Item("ID")
We have to DataSetObj .Tables[0].Rows[0].ItemArray[0];
 
Other have missed this one (some of them)

whenever you see the word .Item in VB.NET, it usually (always?) is the
indexer in c#

so

someObject.Item("ID")
is
someObject["ID"]
in C#

so most times its just [] for (), except for the indexer (which is .Item in
vb.net)

DataSetObj .Tables[0].Rows[0]["ID"]
 
Back
Top