private void button2_Click(object sender, EventArgs e) { string sql = "select * from addaccount where 账号='" + textBox1.Text + "'"; DBOperation.BindDB(dataGridView1, sql); DBOperation.GetDataTable(sql); }
private void button3_Click(object sender, EventArgs e) { string sql = "select * from addaccount"; DBOperation.BindDB(dataGridView1, sql); DBOperation.GetDataTable(sql); }
//static string constr = @"Data Source=DESKTOP-KDKK51O\SQLEXPRESS;Initial catalog=student;integrated Security=True"; private void AccountManage_Load(object sender, EventArgs e) { string sql = "select * from addaccount"; DBOperation.BindDB(dataGridView1, sql); DBOperation.GetDataTable(sql); comboBox1.Text = "请选择"; }
private void button1_Click(object sender, EventArgs e) { string sql = ""; if (xb.Equals("借出信息")) { sql = "select * from income"; } else { sql = "select * from incomein"; } DBOperation.BindDB(dataGridView1, sql); DBOperation.GetDataTable(sql); }
private void button2_Click(object sender, EventArgs e) { if (xb.Equals("借出信息")) { if (comboBox1.Text.Equals("按金额")) { string sql = "select * from income where 借出金额='" + textBox1.Text + "'"; DBOperation.BindDB(dataGridView1, sql); DBOperation.GetDataTable(sql); } else { string sql = "select * from income where 是否回收='" + textBox1.Text + "'"; DBOperation.BindDB(dataGridView1, sql); DBOperation.GetDataTable(sql); } } else { if (comboBox1.Text.Equals("按金额")) { string sql = "select * from incomein where 借入金额='" + textBox1.Text + "'"; DBOperation.BindDB(dataGridView1, sql); DBOperation.GetDataTable(sql); } else { string sql = "select * from incomein where 是否回收='" + textBox1.Text + "'"; DBOperation.BindDB(dataGridView1, sql); DBOperation.GetDataTable(sql); } } }