2 Replies - 274 Views - Last Post: 21 July 2014 - 07:46 AM Rate Topic: -----

#1 torind_2000  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 55
  • View blog
  • Posts: 285
  • Joined: 22-August 11

Help with Datagridview

Posted 16 July 2014 - 08:41 AM

Hello all!

I've been tinkering with vb.net to MySQL for some small work project and have a small issue I'm not sure how to resolve.

I have a datagridview that loads on form load using this code:

Spoiler


I also have a some textboxes that fill when I click in the datagridview with this code:

Spoiler


In order to fill the textboxes using this I had to make the variable DBSET from LoadTable() a global variable.

My update and save buttons work, and the info is saved or updated but each function calls the LoadTable() to refresh the grid afterwards. When it does, I get duplicates of the table. If I make DBSET local to the LoadTable() sub it seems to work fine, but I can't filter.

Can you folks give me some tips on what I should look at?
Thanks!

Is This A Good Question/Topic? 0
  • +

Replies To: Help with Datagridview

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 8962
  • View blog
  • Posts: 33,596
  • Joined: 12-June 08

Re: Help with Datagridview

Posted 16 July 2014 - 12:43 PM

18	        SDA.Fill(dbset)

Perhaps re-instantiate dbset before you fill it. I typically do that each time I run a query to load some data.
Was This Post Helpful? 1
  • +
  • -

#3 torind_2000  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 55
  • View blog
  • Posts: 285
  • Joined: 22-August 11

Re: Help with Datagridview

Posted 21 July 2014 - 07:46 AM

Thanks Modi,
Sorry for the delay, just got back from vacation!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1