Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Connecting to a mySQL server and filling tables with VB - simple help!

  • 03-03-2007 07:54PM
    #1
    Registered Users, Registered Users 2 Posts: 4,946 ✭✭✭


    yo! I've got my program to connect to a mysql server - woop!

    heres the stuff

    Dim conn As MySqlConnection
    Dim sql As String
    Dim da As New MySqlDataAdapter
    Dim ds As DataSet

    conn = New MySqlConnection()
    conn.Open()

    sql = "SELECT * FROM tblEvents"
    da = New MySqlDataAdapter(sql, conn)
    da.Fill(ds, "ClanStuff") <
    This gives error!
    conn.Close()

    It says 'Value cannot be null parameter name dataset'

    Does that mean that i have null data in my DB and its not able to produce it in the program? I've filled a row of data in the DB and that end of stuff looks grand.

    Any help would be great! Cheers


Comments

  • Registered Users, Registered Users 2 Posts: 6,344 ✭✭✭OfflerCrocGod


    This is a total guess on my part but you may need to initialise ds
    Dim ds As DataSet


  • Registered Users, Registered Users 2 Posts: 4,946 ✭✭✭red_ice


    Dim ds As DataSet becomes Dim ds As New DataSet

    urgh.


  • Registered Users, Registered Users 2 Posts: 6,344 ✭✭✭OfflerCrocGod


    red_ice wrote:
    Dim ds As DataSet becomes Dim ds As New DataSet

    urgh.
    That fixed it? I haven't a clue tbh never seen a line of VB code in my life - must say I don't like it much :)


Advertisement