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