Home > Software engineering >  Vb.net DataGridView cannot show the data
Vb.net DataGridView cannot show the data

Time:09-27

Joined the DataGridView in form, the binding of data source, the SQL statement is true, to be able to show the correct results in the query builder, but I don't know why but can't show in the DataGridView?

 
Dim myadpt As SqlDataAdapter=New SqlDataAdapter (" select all ordered goods information table. The name of commodity, the SUM (all ordered goods information table. Order quantity) from the customer order information table, all ordered goods information table where the customer order information table. The order number=all ordered goods information table. The order number GROUP BY all ordered goods information table. Name of commodity ", connstr)
Dim mydt As DataTable=New DataTable
Myadpt. The Fill (mydt)
DataGridView1. The DataSource=mydt

CodePudding user response:

 DataGridView1. AutoGenerateColumns=True 'set the DataSource to automatically create the columns' 
DataGridView1. The DataSource=mydt
  • Related