none
DataGridView FILL RRS feed

  • Question

  • Hi,

    I have a strange problem.

    I'm using a sql database (customer) with 7 columns (just to try) and 5000 rows

    In the Form application I use a DataGridview to list all Customers

    I use BS1 (bindingsource) bound to DataTable and DGV(DataGridView) bound to BS1

    Every thing works well but this is the problem :

    If I use Designer to create The DGV and DataProperty name for each Colummn it takes more then 10 sec to fill DataGridview.

    If I let the program to Autogenerate Columns for DGV it is instantaneous.

    Why  I get this difference ?

    Tuesday, May 22, 2018 4:45 PM

Answers

  • It is not a Problem of TableAdapter or DataTable

    After working I solved the problem. The DatagridView was Corrupted.

    I copied a working project(with Dgv) in another project changing fileds names and after several proves  something went bad.

    So in the new project a deleted the old DGV and create it again with disegner.

    Now the DGV fill is fast

    I have to mark my solution for other people that will ger the same problem

    Thank anyway

    • Marked as answer by Claudio111 Tuesday, May 22, 2018 10:42 PM
    Tuesday, May 22, 2018 10:42 PM

All replies

  • Hello,

    Are you saying that when using the method to create things via a TableAdapter it's slow or not?


    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

    Tuesday, May 22, 2018 5:15 PM
    Moderator
  • No, i'm using data table, no Table Adapter

    The statement BS1.datasource = DataTable1 is istantaneous

    The program is low to process

            DGV.DataSource = Bs1

    Now I'm using autogenerate columns = true  but it is very boring and dangerous to set Dgv column proprierties without using designer

    I hope samebody could help me.

    Tuesday, May 22, 2018 5:40 PM
  • Now I'm using autogenerate columns = true  but it is very boring and dangerous to set Dgv column proprierties without using designer

    I hope samebody could help me.

    Hi

    In what way is it dangerous?


    Regards Les, Livingston, Scotland

    Tuesday, May 22, 2018 5:50 PM
  • The only issue (and there can be issues with many aspects of coding) is if the form becomes corrupt and messing the generated code up yet the backup to this is to use version control.

    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

    Tuesday, May 22, 2018 5:56 PM
    Moderator
  • it is dangerous because a lot of code to write for many proprierties fo each column

    and too many mistake possible.

    Tuesday, May 22, 2018 7:19 PM
  • Anyway Karen

    you think the problem is due to the fact that the form is corrupted ?

    Tuesday, May 22, 2018 7:32 PM
  • it is dangerous because a lot of code to write for many proprierties fo each column

    and too many mistake possible.

    Yea that is why I wrote some weeks ago that using Strongly Typed Datasets with the TableAdaptermanager was more secure. 

    But you put me down as a fool and said that it was nonsense.

    Do you think you are the first one who recognize this?


    Success
    Cor


    Tuesday, May 22, 2018 7:42 PM
  • It is not a Problem of TableAdapter or DataTable

    After working I solved the problem. The DatagridView was Corrupted.

    I copied a working project(with Dgv) in another project changing fileds names and after several proves  something went bad.

    So in the new project a deleted the old DGV and create it again with disegner.

    Now the DGV fill is fast

    I have to mark my solution for other people that will ger the same problem

    Thank anyway

    • Marked as answer by Claudio111 Tuesday, May 22, 2018 10:42 PM
    Tuesday, May 22, 2018 10:42 PM