我想做一个MessageBox确认.这是消息框:
DialogResult dialog = MessageBox.Show("Etes vous sûre de vouloir fermer le programme ?", "Exit",MessageBoxButtons.YesNo);
if (dialog == DialogResult.Yes)
{
Application.Exit();
}
else if (dialog == DialogResult.No)
{
e.Cancel = true;
}
Run Code Online (Sandbox Code Playgroud)
问题是,当我单击YES按钮时,弹出窗口不会自动关闭.我再次点击2次后将关闭.它应该从第一次关闭.
这似乎很容易,但我不确定我的错误在哪里;
我有查询BETWEEN的问题.我试图从两个日期之间的表中选择记录,所以我使用了以下查询:
SqlDataAdapter sda1 = new SqlDataAdapter(
"select distinct * from BLC where DATE_BLC between '" +
dateTimePicker1.Value.ToString() + "' and'" +
dateTimePicker2.Value.ToString() + "'", conx);
Run Code Online (Sandbox Code Playgroud)
当我输入以下日期时:
从2016年2月5日至今日期间15/03/2016
它返回(2016年2月6日至2016年3月15日)日期之间的记录,但是从日期05/02/2016开始的记录,它们不会被返回.当我选择日期时(2016年2月5日至2016年2月5日),这里没有记录.谁能告诉我这里我做错了什么?