I have a problem with the following code:
MySqlConnection conDatabase = new MySqlConnection(myConne);
MySqlCommand cmdDataBase = new MySqlCommand("Select * from supplier_data,brands where brands.supplier_id = supplier_data.supplier_id ", conDatabase);
MySqlDataAdapter sda = new MySqlDataAdapter();
sda.SelectCommand = cmdDataBase;
System.Data.DataTable dbdataset = new System.Data.DataTable();
sda.Fill(dbdataset);
BindingSource bSource = new BindingSource();
bSource.DataSource = dbdataset;
dataGridView3.DataSource = bSource;
sda.Update(dbdataset);
When it displays into datagridview, if one supplier has two brands, duplicates received data but with other brand.
You can group the result by using group-by, So attach the following at the end of your query
Group By brands.supplier_id
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With