Results 1 to 3 of 3

Thread: null datarow, better way?

  1. #1

    Thread Starter
    Member SeaCapnJ's Avatar
    Join Date
    Jun 2003
    Location
    Wilmington, NC
    Posts
    41

    null datarow, better way?

    Currently when I am querying a table, I assign a datarow the values I requested. If the search turns up null, I resolve it -a- la - ghetto. There has to be a better way

    VB Code:
    1. dim rowInput as datarow
    2. dim tblIptval as new datatable
    3.  
    4. Try
    5.    rowInput = tblIptVal.Select("CID = " & CID )(0)
    6. Catch
    7.     'no records
    8. End Try
    Last edited by SeaCapnJ; Apr 30th, 2004 at 04:05 PM.

  2. #2
    Fanatic Member Mr.No's Avatar
    Join Date
    Sep 2002
    Location
    Mauritius
    Posts
    651
    I was l;ooking for a solution also and foun this on MSDN.
    Much ADO About Nothing

    But I would still prefer a simpler method ....
    Using VB.NET 2003/.NET 1.1/C# 2.0
    http://del.icio.us/rajoo
    Blow your mind, smoke gunpowder
    Ashes to ashes, dust to dust
    If God won't have you, the devil will. - Author unknown
    Don't follow me, I'm lost too ...

  3. #3
    Frenzied Member
    Join Date
    May 2002
    Posts
    1,602
    Very interesting article... but if I get the error "attempting to read data when there is no data present" when I access a datareaders itemcollection, does that mean Im accessing a null field or that the entire datarow is scrap...?


    kind regards
    Henrik

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