GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

  GeekInterview.com  >  Interview Questions  >  Microsoft  >  C#

 Print  |  
Question:  Variable Declaration and Assignment

Answer: What is difference between these two statement? if variable is declared and assign value in following two ways

String sValue = (String)GridView1.DataKeys[GridView1.SelectedIndex].Value;
String sValue = GridView1.DataKeys[GridView1.SelectedIndex].Value.ToString();


June 06, 2008 06:49:49 #1
 infoeweb   Member Since: June 2008    Total Comments: 1 

RE: Variable Declaration and Assignment
 

.tostring method doesot handle null value where as other does..

vijay
     

 

Back To Question