IOrderedDictionary does not contain a definition for Item

 hi all,

I have one strange problem.

I am handling gridview RowUpdating event. When I write code in vb.net. it works perfectly:—–

Protected Sub GridView1_RowUpdating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GridView1.RowUpdating
       
Dim d As IOrderedDictionary = e.NewValues
Dim status As String = d.Item("Approval_Status")
Dim oldvalues As IOrderedDictionary = e.OldValues

Dim email As String = oldvalues.Item("Email_Address")

end sub

 

but while using the same code in C# like this:———

  protected void GridView2_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
      
      System.Collections.Specialized.IOrderedDictionary idic= e.NewValues;
  
      string email = idic.Item("Email_Address");
       
     }

______________This gives compile time error: :———–

Error    3    'System.Collections.Specialized.IOrderedDictionary' does not contain a definition for 'Item'  

why this strange behavior in language switching. while .net is language interoperable plateform. 
 

 

Read More

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s