Results 1 to 2 of 2

Thread: null values to column in the datagrid

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2003
    Posts
    5

    null values to column in the datagrid

    Hello,

    I have a problem Here.
    I have a button fetch all, when i press the button
    i will frame a select statement like
    sstr = ""
    sstr = sstr + select menu_id,"
    sstr = sstr + parent_id,"
    sstr = sstr + menutext,"
    sstr = sstr + iconfile,"
    sstr = sstr + appid,"
    sstr = sstr + from menurelations"

    orada = new oracleclient.oracleadapter

    orda.fill(ds,"menurelations")

    datagrid_menulist(ds,"menurelations")

    the value has been populated in the grid.
    Here i will have the problem.
    If there is a null value in the say in iconfile or
    some of the fields.How to pass empty values
    to the grid.when i say nvl(iconfile,' ') iconfile this
    will solve my problem.But if i have more than 20
    or 30 fields in the table will have null values suppose.
    Generally how do i handle this.


    hope the question is clear.


    Thanks and regards
    shawlin

  2. #2
    Frenzied Member
    Join Date
    Oct 2002
    Location
    Gammapolis
    Posts
    1,474
    You may pass DBNull.Value instead of any null value to the database. In case of strings "" will pass a string that is empty, still its not a null value that means nothing at all.
    'Heading for the automatic overload'
    Marillion, Brave, The Great Escape, 1994

    'How will WE stand the FIRE TOMORROW?'
    Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width