I have previously created a DataGridView.DataSource="a query"
and then I want to add another row to that from another query '
if (result== DialogResult.OK)
{
DataTable tb1 = ConexionBD.Data("SELECT Id, Nombre, Cantidad as Disponibilidad, 1 Cantidad, Precio FROM Producto WHERE Id = '"+captura[0]+"'");
if (tb1.Rows.Count == 0)
{
MessageBox.Show("No se encuentra ningun producto con ese Codigo");
}
else
{
if (tablaVenta.Rows.Count==0)
{
tablaVenta.DataSource = tb1;
}
else
{
tablaVenta.Rows.Add(tb1.Rows[0][0], tb1.Rows[0][1], tb1.Rows[0][2], tb1.Rows[0][3], tb1.Rows[0][4]);
}
}
}
else
{
cxProduc.SelectedIndex = 0;
}