Einar,
There's lots of differences in stuff between VB and C#. You should use this syntax for a DataView in C#:
return dv[0]["OptionValue"];
That should work.
~~Bonnie
>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