Results 1 to 3 of 3

Thread: datatype

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2002
    Location
    London
    Posts
    678

    datatype

    Hi,
    My question is to do with the datatype?
    In the constructor of a class, I am initializing the variables which are of various types (i.e: string, double, decimal, etc...)
    These are initialized such as "" for string and 0 for int or 0 for double, etc...
    Let's say that during a call to the DB, only one of them gets set (i.e: the string variable = "hello") but the other variables are not set. So obviously the other variables are set to 0 of they are decimal for example.
    The question is that how is it possible to find out that the other variables that were not set?. I.e: how can I return null for the other variables?

    Hope this is clear
    Thanks

  2. #2
    Fanatic Member
    Join Date
    Oct 2000
    Location
    Reading, UK
    Posts
    870
    use an inline iif statement when returning values

    iif(intNum = 0, system.dbnull, intNum)
    www.vb-tech.com
    .Net Freelance Development
    http://weblog.vb-tech.com/nick
    My blog

  3. #3
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Or more flexible , create two or three constructors with different variable declarations .

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