Exforsys
+ Reply to Thread
Results 1 to 2 of 2

Problem with Object Conversion [in vb.net]

This is a discussion on Problem with Object Conversion [in vb.net] within the Microsoft .NET forums, part of the Programming Talk category; Hi All ! esp. For Seniors i have the :- code { Dim DrObj as Object = ksDr.KSGetValue(\"SELECT SetId FROM ...

  1. #1
    Kartik is offline Junior Member Array
    Join Date
    Sep 2004
    Answers
    4

    Problem with Object Conversion [in vb.net]


    Hi All !

    esp. For Seniors
    i have the :- code
    {
    Dim DrObj as Object = ksDr.KSGetValue(\"SELECT SetId FROM SetDetails\")
    Dim dobj as integer = DrObj

    If dobj =0
    blah blah
    blah blah

    }

    KSGetValue is a custom-Sub which Returns a value thru a Select Query !
    Can the same be Done as

    dobj = Conversion.Int(DrObj)

    dobj = Cint(DrObj)

    Dim dobj as integer = DrObj

    Which one of these 3 is Recommended ???

    Please do Reply with Solution....
    Shankar/Kartik.

    Post edited by: Kartik, at: 2004/12/29 09:52


  2. #2
    Kartik is offline Junior Member Array
    Join Date
    Sep 2004
    Answers
    4

    Re:Problem with Object Conversion [in vb.net]

    Clarification :


    KSGetValue returns a Scalar Object ;

    But then; In my Code-Blocks; where i\'m Retrieving a Particular Single Entry From SQL back-end; i\'m Not Getting The Value i wanted the Code to Return ?!



    So, i was asking Which among these 3 to use ?


Latest Article

Network Security Risk Assessment and Measurement

Read More...