vb to cSharp conversion

A

arun

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

Thanks in Advance
 
C

Cowboy \(Gregory A. Beamer\)

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

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

arun

(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];
 
S

sloan

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"]
 

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

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top