Skip to content
Loading
  • Balaji Palani
    0
    boxing and unboxing concepts
    Code
    int id  = (int)result ;
    Code
    Code
    for your reference
    Code
    Code
    int i = 123;      // a value type
    Code
    object o = i;     // boxing
    Code
    int j = (int)o;   // unboxing
    Code
    Code
    0
  • Salman Beg
    0
    This should work,
    int id = (int)result;
    thanks.
    0
  • 0
    balaji palani:your answer is not working..
    0
  • 0
    check u r query once ...what it returns?.. or share some code .
    0
  • 0
    id=(int)result;
    this is enough..it should work
    0
  • 0
    I tried all your code....but not works....
    error when
    int id = (int)result ;
    "Specified cast is not valid"
    0
  • 0
    I got the answer.....pblm is with value returned from database. thank you all..
    0