private void ShowSell_Load(object sender, EventArgs e) { string Error = ""; DBProduct obj = new DBProduct(); DataTable table = obj.getAllSellsData(ref Error); if (Error != "") { MessageBox.Show(Error); } else { dataGridView1.DataSource = table; } }