2015年8月19日 星期三

C# winForm 確定刪除~確認視窗

private void delButton_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("確定刪除?", "提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                string sql;
                string cN;
                cN = Convert.ToString(DGV.CurrentRow.Cells[0].Value);

                sql = string.Format("delete from record where cardno='{0}' ",cN);
                dbCom.myselect(sql);

            }
        }

沒有留言:

張貼留言