winform中根据combobox 条件怎么把查询出的东西放在datagridview上显示啊
应该是textBox1和时间条件查询语句······数据库是ORACLEstringkehuID=this.textBox1.Text;stringkehuNAME=th...
应该是textBox1和时间 条件 查询语句······ 数据库是ORACLE
string kehuID = this.textBox1.Text;
string kehuNAME = this.textBox2.Text;
//if (kehuID.Equals("客户ID"))
//{
string connectionString = "Provider=MSDAORA; Data Source=ORA13;" + "Persist Security Info=True; User ID=cnpls; Password=cnpls";
OleDbConnection conn = new OleDbConnection(connectionString);
OleDbDataAdapter arr = new OleDbDataAdapter("select * from m_client where clientcode='" + this.textBox1.Text.Trim() + "' or clientname='" + this.textBox1.Text.Trim() + " ", conn);
DataSet dataset = new DataSet();
dataGridView1.DataSource = dataset
dataGridView1.DataMember = "arr";这是我写的怎么改 展开
string kehuID = this.textBox1.Text;
string kehuNAME = this.textBox2.Text;
//if (kehuID.Equals("客户ID"))
//{
string connectionString = "Provider=MSDAORA; Data Source=ORA13;" + "Persist Security Info=True; User ID=cnpls; Password=cnpls";
OleDbConnection conn = new OleDbConnection(connectionString);
OleDbDataAdapter arr = new OleDbDataAdapter("select * from m_client where clientcode='" + this.textBox1.Text.Trim() + "' or clientname='" + this.textBox1.Text.Trim() + " ", conn);
DataSet dataset = new DataSet();
dataGridView1.DataSource = dataset
dataGridView1.DataMember = "arr";这是我写的怎么改 展开
展开全部
textBox1.Text就可以得到值了,然后就是构造sql语句,执行并返回结果集,把结果集赋值给datagridview的datasource属性就可以了!思路给你了,不懂继续交流,别要代码,看别人代码一点意思没有!要学习就自己来!
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询