Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DataView.Item property
Message
General information
Forum:
ASP.NET
Category:
Other
Title:
DataView.Item property
Miscellaneous
Thread ID:
00977752
Message ID:
00977752
Views:
62
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.
Next
Reply
Map
View

Click here to load this message in the networking platform