Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Check tinytext column in MySQL Database with VB.NET

Check tinytext column in MySQL Database with VB.NET

Scheduled Pinned Locked Moved Visual Basic
tutorialcsharpdatabasemysql
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    drexler_kk
    wrote on last edited by
    #1

    Hello all,I am wondering anyone can guide me how to read tiny text column for MySQL using VB.NET Datareader. The following are the code I used to read the column:

    Public Function StartupData(ByVal strKeySet as String)
    Dim test as string
    Dim MyTinyText as string

    Try
    ObjComm = New OdbcCommand("SELECT SettingValue FROM pos_setting WHERE LocationCode='KK' AND SettingKey='ADD_BINLOG'", ObjConn)
    ObjConn.Open()
    ObjRead = ObjComm.ExecuteReader()
    If ObjRead.Read Then
    test = ObjRead.Item(0)
    MessageBox.Show("This is " & test & "")
    Else
    MessageBox.Show("No value")
    End If
    ObjConn.Close()

    Catch ex As Exception

    Finally
    Objconn.Close
    End Try

    And my database table as follow:

    /*Column Information For - test.pos_setting*/

    Field Type Collation Null Key Default Extra Privileges Comment


    LocationCode varchar(10) latin1_swedish_ci NO PRI select,insert,update,references
    SettingKey varchar(10) latin1_swedish_ci NO PRI select,insert,update,references
    SettingValue tinytext latin1_swedish_ci YES (NULL) select,insert,update,references

    I'm wondering why its keep showing there is no data read inside the datareader? Actually there is a '0' inside the SettingValue for that row of data but I'm wondering why it doesn't read it? Anyone can give me a solution for this? Thanks for reading~!

    L 1 Reply Last reply
    0
    • D drexler_kk

      Hello all,I am wondering anyone can guide me how to read tiny text column for MySQL using VB.NET Datareader. The following are the code I used to read the column:

      Public Function StartupData(ByVal strKeySet as String)
      Dim test as string
      Dim MyTinyText as string

      Try
      ObjComm = New OdbcCommand("SELECT SettingValue FROM pos_setting WHERE LocationCode='KK' AND SettingKey='ADD_BINLOG'", ObjConn)
      ObjConn.Open()
      ObjRead = ObjComm.ExecuteReader()
      If ObjRead.Read Then
      test = ObjRead.Item(0)
      MessageBox.Show("This is " & test & "")
      Else
      MessageBox.Show("No value")
      End If
      ObjConn.Close()

      Catch ex As Exception

      Finally
      Objconn.Close
      End Try

      And my database table as follow:

      /*Column Information For - test.pos_setting*/

      Field Type Collation Null Key Default Extra Privileges Comment


      LocationCode varchar(10) latin1_swedish_ci NO PRI select,insert,update,references
      SettingKey varchar(10) latin1_swedish_ci NO PRI select,insert,update,references
      SettingValue tinytext latin1_swedish_ci YES (NULL) select,insert,update,references

      I'm wondering why its keep showing there is no data read inside the datareader? Actually there is a '0' inside the SettingValue for that row of data but I'm wondering why it doesn't read it? Anyone can give me a solution for this? Thanks for reading~!

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Repost http://www.codeproject.com/script/Forums/View.aspx?fid=1646&msg=2574964[^]

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups