IISEXPRESS SLOW

0
0

Hi,

For a few weeks now, I’ve been developing with the following environments:
VS 2022;
Wisej 3.5
NET framework 4.8
I have datagridviews with columns that I add manually and with the autogeneratecolun option. The grid is bound to the datasource.
I’ve noticed that in debug mode, opening the form sometimes takes up to 10 seconds. If the application is published on an IIS server, everything works smoothly.
From my tests, it seems to be due to the manual configuration of the columns.
From research, I’ve read that the problem could be caused by iisexpress, which is slower with newer versions of Wisej.
Any suggestions?

 

Tanks in advance

  • You must to post comments
0
0

Hi Frank,

In Release Mode I have the same performance.

I notice that the problem is when then form create the columns on the grid for the first time.

In fact, if instead of closing the form, I execute the ‘Hide’ method and subsequently ‘Show’ the problem does not occur.

 

Best regards
Angelo

  • You must to post comments
0
0

Hi Angelo,

what is the performance when you run your project inside Visual Studio in Release Mode?

Best regards
Frank

  • You must to post comments
0
0

Hi Frank,
When Running in debug mode inside Visual Studio.
If it helps, I’ll briefly describe what the software does when the form opens.
– The form contains a custom datagridview.
– The form’s MyBase.Load event calls the ‘DGV_M_SetColumns‘ method which adds the columns to the grid:

Typical code for adding a column

txtC = New ASNetL.Wsj3.Forms.wDataGridViewTextBoxColumn
FieldName = “prfvcl_targa”
With txtC
.Name = FieldName
.DataPropertyName = FieldName
.HeaderText = “PLATE”
.Width = 150
.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleLeft
.DefaultCellStyle.Format = “”
.ToolTipText = “Vehicle License Plate”
.Visible = True
.FilterEnable = True
.EditModeOnGrid = ASNetL.Wsj.wEnum.EditModeOnGridEnum.NoEditable
‘I add the column to the grid
DGV_M_GRD.Columns.Add(txtC)
End With

– The MyBase.Shown event of the form calls the ‘FILL‘ method which essentially performs the binding of the grid:

PgSQL_Conn = New NpgsqlConnection(ConnStr)
PgSQL_Conn.Open()
DgvData.Clear()
PgSQL_Command.Connection = PgSQL_Conn
PgSQL_Command.CommandText = qry + WhereFlt
PgSQL_Adapter.SelectCommand = PgSQL_Command
PgSQL_Adapter.Fill(DgvData)

dgvBindingSource.DataSource = DgvView
dgv.AutoGenerateColumns = False
dgv.DataSource = dgvBindingSource

In summary, I noticed that the ‘DGV_M_SetColumns’ method slows down the form display (up to 10 seconds). In fact, if it’s commented out (and I don’t call it), the form displays quickly. However, this only happens when running with Visual Studio (IISExpress). If the application is deployed on a server (IIS), everything works without any delays.

Tanks

 

  • Gabriele1 Del Giovine
    You don’t have to load the datagridview in the Show event handler. Place (or call) the grid columns definition into the form constructor method or into the Load event handler. Also the call the data retrieval/databinding actions into the form Load event handler. So please check the autosize mode of you datagridview. If there are great number of rows into the datagridview datasource the automatic size require extra time to find the max widht of every column scanning every row….
  • Frank (ITG)
    Thanks Gabriele, these are good points. Did you try to move your code from the Show Event handler, Angelo? Best regards, Frank
  • Angelo Bordonaro
    I’ve tried all of Gabriele’s suggestions, but the problem persists. As mentioned, the slowdown only occurs when the application runs in VB.net debug, i.e., with IISExpress. If deployed on any server, i.e., IIS, everything runs smoothly. I don’t know if it’s a problem with my PC, Visual Studio, Wisej, or some setting in IIS Express. Any suggestions?
  • You must to post comments
0
0

Hi Angelo,

what does “open the form” actually mean? Open in the designer or running in debug mode inside Visual Studio?

Best regards
Frank

  • You must to post comments
Showing 4 results
Your Answer

Please first to submit.