Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DataView.Item property
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
DataView.Item property
Divers
Thread ID:
00977752
Message ID:
00977752
Vues:
63
I have some problems getting the following code to compile:
DataView dv = dsOptions.Tables["ConfigValues"].DefaultView;
dv.RowFilter = "OptionName='" + paraOptionName + "'";

if (dv.Count > 0)
{
	return dv.Item[0].Item("OptionValue");
}
else
{
	return "";
}
I receive the following error:
'System.Data.DataView' does not contain a definition for 'Item'
This code is "borrowed" from an article from CodeProject and was originally VB.NET. This is the original code (only problematic code listed):
Return CStr(dv.Item(0).Item("OptionValue"))
I did some searchine and the M$ docs tells me that there is an item property for the DataView class, but intellisense does not reveil if for me. I think I have used the correct syntax when translating from VB.NEt to C#.

If anyone could let me know what is wrong that would be great.

Thanks,
Einar
Semper ubi sub ubi.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform