none
Load Data From MySQL Database RRS feed

Answers

  • Steps

    1. Create a connection, set the connection string
    2. Create a command, set the connection property to the connection above
    3. Write a SELECT statement for the command and assign it to the command.CommandText
    4. Open the connection
    5. Execute e.g. Dim Reader = cmd.ExecuteReader
    6. Check Reader.HasRows, if true continue, if false stop
    7. If true, and you want one field for a TextBox execute Reader.Reader
    8. Read the value into the TextBox use Reader.Get......

    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    • Marked as answer by no[one] Saturday, April 21, 2018 6:07 AM
    Friday, April 20, 2018 5:26 PM
    Moderator

All replies

  • Steps

    1. Create a connection, set the connection string
    2. Create a command, set the connection property to the connection above
    3. Write a SELECT statement for the command and assign it to the command.CommandText
    4. Open the connection
    5. Execute e.g. Dim Reader = cmd.ExecuteReader
    6. Check Reader.HasRows, if true continue, if false stop
    7. If true, and you want one field for a TextBox execute Reader.Reader
    8. Read the value into the TextBox use Reader.Get......

    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    • Marked as answer by no[one] Saturday, April 21, 2018 6:07 AM
    Friday, April 20, 2018 5:26 PM
    Moderator
  • The below link has tutorials that demonstrate how to get data using ExecuteScalar or ExecuteReader:

    http://zetcode.com/db/mysqlvb/


    Paul ~~~~ Microsoft MVP (Visual Basic)

    Friday, April 20, 2018 7:43 PM