Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dataset.Tables[0].Rows[0]????? why not working??

Status
Not open for further replies.

rahmanjan

Programmer
Apr 13, 2003
180
AU
hi all,

In vb.net I am getting the column values from a filled dataset by:

clientname=dataset.Tables(0).Rows(0).Item("ClientName")

I am hopeing that .Net framework brings the standard and be able to do it same in c#. But not really ... The 'Item' doesn't exist in Rows(0).

dataset.Tables[0].Rows[0].?? //No item here??

My questions?

1- Why its differnt in c# and Vb.net while in same .Net framework Object Model?

2-How can do the same thing in C#?

regards
 
yeap its there.
But how do you get it? ;-)

regards
 
If it is there, what do you mean to "get it"? Is there a compiler error if you use it?
 
In C# the item is implied for properties that take parameters. So in C#

clientname=dataset.Tables[0].Rows[0]["ClientName"]
 
christ sake!!

Property that gets parrameters??? looks very unsual. ;-) By the way why C# is this much un-consistant?/

thanks for your help john,

regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top