Results 1 to 11 of 11

Thread: DataGridView reload

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2007
    Posts
    362

    Question DataGridView reload

    After adding a row into the DB i am using the following to show me the DGV containing recently added data but it is not showing up.

    Code:
    MWClientDataSet.Clear()
    ClientProfileTableAdapter.Fill(MWClientDataSet.ClientProfile)
    What should i do?

  2. #2
    Addicted Member
    Join Date
    Oct 2008
    Posts
    152

    Re: DataGridView reload

    Need more info to go on.... Are you sure the new record has successfully being inserted into the database? Have you checked to make sure your fill has returned any/all records, what is the table record count before & afterwards. Also you are not showing the coding that binds your datatable to the dgv, are you sure this is set correctly and on the right dataset?

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2007
    Posts
    362

    Re: DataGridView reload

    Yes the record has successfully been inserted into the DB. The DGV is perfectly bound to the DataTable as i am using the second statement to populate it on Load. But once i have inserted the record into the DB, passing this command doesn't show up the new data. Even if new row is not of concern, the edited data is also not getting refreshed in DGV.

    Is there any other way to do this?

  4. #4
    Addicted Member
    Join Date
    Oct 2008
    Posts
    152

    Re: DataGridView reload

    Again, your coding is not showing how the data is being bound to the dgv or even if its the same dataset or not...

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2007
    Posts
    362

    Re: DataGridView reload

    :| :|

  6. #6
    Hyperactive Member
    Join Date
    Dec 2007
    Location
    Somewhere else today
    Posts
    355

    Re: DataGridView reload

    As long as the data is being saved, you do not need to reload the datagridview if the data is already in the datagridview.

    The .CLEAR event "Clears the DataSet of any data by removing all rows in all tables.", so when you come to reload the the datagridview there is nothing there.

    Computerman
    It was much easier in VB6, but I am now liking Vb.Net alot more.

  7. #7
    Addicted Member
    Join Date
    Oct 2008
    Posts
    152

    Re: DataGridView reload

    If the data is saved as he said it was, the tables should be recreated and refilled showing the new data when he calls the fill. So this is not the problem

  8. #8

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2007
    Posts
    362

    Re: DataGridView reload

    anyone please???

  9. #9

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2007
    Posts
    362

    Re: DataGridView reload

    hello ??

  10. #10
    Hyperactive Member
    Join Date
    Dec 2007
    Location
    Somewhere else today
    Posts
    355

    Re: DataGridView reload

    Can you show me your code for updating the dataset.

    Computerman
    It was much easier in VB6, but I am now liking Vb.Net alot more.

  11. #11

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2007
    Posts
    362

    Re: DataGridView reload

    I am not using dataset to update my DB. I am using DataGridView only to show the records from DB. I am adding, editing the DB through other forms. What i am looking for is to refresh the DataGridView to show current data. Thats it!.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width