Hi guys,

I’ve written an application and I’m trying to utilise a database behind it. I’ve created a mysql database, and table which all appears to work correctly. I appear to have connected to the db correctly too. And hit a bit of a brick wall. As a side-note, within Visual studio connected to the database using the add data source wizard, I then dragged and dropped my db table’s column onto my form that intends to display them all (6 textboxes, including primary key) and that now displays the first record of the table. I’m not sure how i did this so clarification would be appreciated! Haha. It confused me, because i did this as soon as I had setup the database with no visual basic code assisting, so there wasn’t even a connection string?!

One functionality i want to have is to press a button and cycle through the table’s records using the form by the unique id, how would I do this? I’m essentially asking how can I enter a number in a textbox which would then return me the relevant primary key and data attached to that record.

Help would be appreciated.

If you go in the properties of the project, in the settings tab you can see the connection string used.
Then, if you go in the designer part of the form, yu'll find all the struff Visual Studio created.

The easy way to do what you want is to add to the form a binding source, an a binding navigator. Here a how to video.

Hope this helps

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.