combobox 更新
privatevoidbutton2_Click(objectsender,EventArgse){if(string.IsNullOrEmpty(comboBox4.T...
private void button2_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(comboBox4.Text))
{
MessageBox.Show("不能为空", "提示");
return;
}
string strsql = "begin transaction declare @R_num int; select @R_num=R_num from 入库流水账 where G_number=" + comboBox5.Text + "and R_number=" + comboBox4.Text + ";delete from 入库流水账 where R_number =" + comboBox4.Text + "and G_number=";
strsql += comboBox5.Text + ";update 库存帐 set G_store=G_store-@R_num where G_number="+comboBox5.Text+"commit transaction;";
ExeDMLSQl(strsql);
ExeQuerySql(ShowAllData);
comboBox4.Items.Clear();
conn.Close();
conn = new SqlConnection(ConnectString);
conn.Open();
SqlCommand cmd = new SqlCommand("select * from 入库流水账", conn);
SqlDataReader rea = null;
rea = cmd.ExecuteReader();
while (rea.Read())
{
comboBox4.Items.Add(rea["R_number"]);
}
rea.Close();
}
点击button之后,连同combobox也更新,可操作之后,并没有更新 展开
{
if (string.IsNullOrEmpty(comboBox4.Text))
{
MessageBox.Show("不能为空", "提示");
return;
}
string strsql = "begin transaction declare @R_num int; select @R_num=R_num from 入库流水账 where G_number=" + comboBox5.Text + "and R_number=" + comboBox4.Text + ";delete from 入库流水账 where R_number =" + comboBox4.Text + "and G_number=";
strsql += comboBox5.Text + ";update 库存帐 set G_store=G_store-@R_num where G_number="+comboBox5.Text+"commit transaction;";
ExeDMLSQl(strsql);
ExeQuerySql(ShowAllData);
comboBox4.Items.Clear();
conn.Close();
conn = new SqlConnection(ConnectString);
conn.Open();
SqlCommand cmd = new SqlCommand("select * from 入库流水账", conn);
SqlDataReader rea = null;
rea = cmd.ExecuteReader();
while (rea.Read())
{
comboBox4.Items.Add(rea["R_number"]);
}
rea.Close();
}
点击button之后,连同combobox也更新,可操作之后,并没有更新 展开
1个回答
AiPPT
2024-09-19 广告
2024-09-19 广告
AiPPT软件是一款由北京饼干科技有限公司开发的智能PPT生成工具,用户可通过官方渠道下载。该软件基于人工智能大模型和自然语言处理技术,支持一键生成高质量PPT,提供丰富的模板和素材选择,满足不同场景需求。用户只需输入主题或文档资料,即可快...
点击进入详情页
本回答由AiPPT提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询