CS0121 error

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Ok, I'm REALLY confused. I'm new to C# and i am getting an error that has be
throughly mystified.

CS0121: The call is ambiguous between the following methods or properties:
'DreamweaverCtrls.DataSet.FieldValue(string,
System.Web.UI.WebControls.DataListItem)' and
'DreamweaverCtrls.DataSet.FieldValue(string,
System.Web.UI.WebControls.DataGridItem)'

Has anyone else run across this? I am simply attempting to assign a value to
a drop-down & radio group control upon entering a page.

I can post code if it will be of use.
 
Noah said:
Ok, I'm REALLY confused. I'm new to C# and i am getting an error that has be
throughly mystified.

CS0121: The call is ambiguous between the following methods or properties:
'DreamweaverCtrls.DataSet.FieldValue(string,
System.Web.UI.WebControls.DataListItem)' and
'DreamweaverCtrls.DataSet.FieldValue(string,
System.Web.UI.WebControls.DataGridItem)'

Has anyone else run across this? I am simply attempting to assign a value to
a drop-down & radio group control upon entering a page.

I can post code if it will be of use.
It would help if you could show the line of code you're having a problem
with.

On a hunch, do you have something like this:

....FieldValue("SomethingHere", null) <-- null is what I'm looking for

If you do, try specifying the type:

....FieldValue("SomethingHere", (DataListItem)null);

or similar, might work...
 
Here are the two lines in question:

<% drpTopicType.SelectedIndex =
drpTopicType.Items.IndexOf(drpTopicType.Items.FindByValue(dsEditNews.FieldValue("NewsType", null) )); %>
&
<% rdoHotTopic.SelectedIndex =
rdoHotTopic.Items.IndexOf(rdoHotTopic.Items.FindByValue(dsEditNews.FieldValue("NewsSticky", null) )); %>

From what you wrote, I assume I should try it like this:

<% drpTopicType.SelectedIndex =
drpTopicType.Items.IndexOf(drpTopicType.Items.FindByValue(dsEditNews.FieldValue("NewsType", (DataListItem)null) )); %>

Well, that prevented the error, but those two fields are now not showing the
incomming value fields, nor are they performing the updated when changed.

Any ideas would be most welcome.
 
Back
Top