Casting in vb.net

Discussion in 'ASP .Net' started by martin, Jan 16, 2004.

  1. martin

    martin Guest

    Hi,

    I have blob field in my database.
    I am retrieveing the field through a stored procedure and the execute scalar
    method.

    I would like to cast resulting "byte" field to a string.
    I am using the syntax

    strDesciption = CType(objCMD.ExecuteScalar(), String)

    as I have been reliable informed the C# sytax

    string value = (string)command.ExecuteScalar();

    works fine.

    Have a got this translation wrong?? or is it not possible to do this in
    vb.net

    anyadvice is appreciated.

    cheers

    martin.
     
    martin, Jan 16, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Davide
    Replies:
    0
    Views:
    1,379
    Davide
    Oct 30, 2003
  2. Ron
    Replies:
    3
    Views:
    3,488
    S. Justin Gengo [MCP]
    Jan 24, 2006
  3. kevin
    Replies:
    11
    Views:
    5,810
    Andrew McDonagh
    Jan 8, 2005
  4. Wally Barnes
    Replies:
    3
    Views:
    529
    Wally Barnes
    Nov 20, 2008
  5. Sosuke

    Up casting and down casting

    Sosuke, Dec 20, 2009, in forum: C++
    Replies:
    2
    Views:
    565
    James Kanze
    Dec 20, 2009
Loading...

Share This Page