locked
getting error when code converted from vb to c# RRS feed

  • Question

  • User1455579919 posted

    if (row["foo"]=="" )
    {
    parentNode.ContextMenuID = "";

    }

    i get the error  Possible unintended reference comparison on row 

    Thanks 

    Thursday, August 22, 2013 3:11 AM

Answers

  • User-1716253493 posted

    What error you are getting?

    Try this

    if (row["foo"].ToString()=="")
    {
       parentNode.ContextMenuID = "";
    }



    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, August 22, 2013 4:09 AM

All replies

  • User-1360095595 posted

    Not a vb person but I think you need to use () instead of [] and a single = instar of two.

    Thursday, August 22, 2013 3:14 AM
  • User1455579919 posted

    Soory i meant vb to c# 

    Thursday, August 22, 2013 3:16 AM
  • User-1360095595 posted

    Ah Ok. What is the type of row? 

    Thursday, August 22, 2013 3:31 AM
  • User-1716253493 posted

    What error you are getting?

    Try this

    if (row["foo"].ToString()=="")
    {
       parentNode.ContextMenuID = "";
    }



    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, August 22, 2013 4:09 AM