hello how do we write similar coded data in datagridview by summing the number in a single line
C#:
private void cmbBarkod_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
try
{
SqlConnection con = bgl.baglantim();
SqlCommand cmd = new SqlCommand("Select * from S where msg_S_0078='" + cmbBarkod.Text + "'", con);
int _parameter = Convert.ToInt32(cmd.ExecuteScalar());
con.Close();
if (_parameter == 0)
{
MessageBox.Show("Bu Barkoda Ait Ürün Bulunmamaktadır", "UYARI",MessageBoxButtons.OK,MessageBoxIcon.Information);
}
else
{
getir();
}
}
catch(Exception EX)
{
MessageBox.Show(EX.Message, "UYARI");
}
}
Hesapla();
}
void getir()
{
bgl.Reader2("select * from S where msg_S_0078='" + cmbBarkod.Text + "'", datagrid_veriler, "msg_S_0078", "msg_S_0870", "PERAKENDE", adet);
cmbBarkod.Text = string.Empty;
}
Last edited by a moderator: