private void btnAdd_Click(object sender, EventArgs e)
{
//校验
if ((txtprice.Text == "") || (txtquantity.Text == "")
|| (txtdiscount.Text == "") || (txtgid.Text == "")
|| (txtname.Text == "") || (txtdate.Text == "") || (txtcolor.Text == "") || (txtsize.Text == "")
|| (txtshuxing.Text == "") || (txtbrand.Text == ""))
{
MessageBox.Show("不能为空。");
return;
}
......................
阅读全部 | 2016年6月8日 13:40
private void btndelete_Click(object sender, EventArgs e)
{
int txtnumber = Convert.ToInt32(dataGridView1["Sid", dataGridView1.CurrentCell.RowIndex].Value);
string sql = "delete from xiaoshoubiao where Sid=" + txtnumber.ToString();
try
{
OleDbCommand myconn = new OleDbCommand(sql, myOleConn);
myconn.ExecuteNonQuery();
RefreshDG();
}
catch (Exception ea)
{
......................
阅读全部 | 2016年6月8日 10:51