Results 1 to 3 of 3

Thread: [RESOLVED] [2005] Retrieving TinyInt values using the SQLDataReader

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2007
    Posts
    102

    Resolved [RESOLVED] [2005] Retrieving TinyInt values using the SQLDataReader

    Edited:

    Sorry, needed more help than initially thought... please check this link: http://vbforums.com/showthread.php?t=486068

    How do I retrieve tinyint values through the SqlDataReader?

    I've tried the GetInt32 method, but obviously this requires some kind of casting to be performed?

    Any help would be greatly appreciated.

    Thanks.
    Last edited by pizzaboy; Aug 28th, 2007 at 11:48 AM.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2005] Retrieving TinyInt values using the SQLDataReader

    As the documentation for the SqlDbType enumeration says, this is how SQL Server integer types map to .NET types:

    BigInt = Int64 (Long)
    Int = Int32 (Integer)
    SmallInt = Int16 (Short)
    TinyInt = Byte

    Therefore to get a TinyInt value you'd call GetByte.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Aug 2007
    Posts
    102

    Re: [2005] Retrieving TinyInt values using the SQLDataReader

    Thanks jmcilhinney.

    Very useful cross reference.

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