title: while filling tha data grid view taking long time and system getting hang
body: <p>in my windows for i have a data grid view..i am filling data grid view like this:</p>
  
  <pre><code>Sub filldgv()
          Try
  
  
          Dim dt As New DataTable
          dt.Columns.Add("Tbarcode", GetType(String))
          dt.Columns.Add("PlateNo", GetType(String))
          dt.Columns.Add("DelEcode", GetType(String))
          dt.Columns.Add("KRRT", GetType(Integer))
          dt.Columns.Add("DT", GetType(Integer))
  
  
  
          DGVReleased.DataSource = dt
          DGVReleased.Columns(0).Width = 120
          DGVReleased.Columns(1).Width = 65
          DGVReleased.Columns(2).Width = 65
          DGVReleased.Columns(3).Width = 60
          DGVReleased.Columns(4).Width = 60
          ' Task.Factory.StartNew(Sub() Populate(dt))
          Dim bgw = New BackgroundWorker()
          AddHandler bgw.DoWork, Sub() Populate(dt)
              bgw.RunWorkerAsync()
          Catch ex As Exception
  
          End Try
      End Sub
      Sub Populate(ByVal dt As DataTable)
  
          Try
  
  
          Using reader As TextReader = File.OpenText("C:\Program Files\IBS\login.txt")
              txtvalue = Integer.Parse(reader.ReadLine())
  
          End Using
          Glocid = txtvalue
          Dim cmd = New SqlCommand("IBS_fetchreqVehicleinPodium")
  
          cmd.CommandType = CommandType.StoredProcedure
          cmd.Connection = con.connect
          cmd.Parameters.Add("@locid", SqlDbType.Int).Value = Glocid
  
          Dim dr = cmd.ExecuteReader
          While dr.Read
              DGVReleased.AutoGenerateColumns = True
  
              Dim o = {dr("TBarcode").ToString(),
                       dr("PlateNo").ToString(),
                       dr("DelEcode").ToString(),
                       If(IsDBNull(dr("KRRT")), 0, dr("KRRT")),
                       If(IsDBNull(dr("DT")), 0, dr("DT"))}
  
              dt.Rows.Add(o)
          End While
  
  
          dr.Close()
          con.disconnect()
              changecolor()
          Catch ex As Exception
  
          End Try
      End Sub
  </code></pre>
  
  <p>i have button in my form
  then i will call <strong>filldgv</strong> method in my button click event..when ever the data inside the grid view more than 100 then i press my button its taking long time to load the data and  application getting hang ...
  how i can resolve this issue.. 
  any help is very appriciable?</p>