OracleConnection conn = dbc.getConnection();//获得conn连接
try
{
DataTable dt = new DataTable();
//注:bz为违法行为字段
OracleDataAdapter sda = new OracleDataAdapter("SELECT xh,hpzl,hphm,bz,larq,fdjh,clpp,cjh,jdcsyr,cllx,csys FROM kk.kkhmd WHERE 1 = 1 " + hphm + " ",conn);//查询黑名单表
if (checkBox1.Checked == true)
{
sda.SelectCommand.Parameters.Add("textBox1", OracleType.VarChar).Value = textBox1.Text;//给hphm传参
}
else
{
}
sda.Fill(dt);
dataGridView1.DataSource = dt;
}
catch (Exception ee)
{
MessageBox.Show(ee.Message.ToString());
}
黑色头发:http://heisetoufa.iteye.com