我想使用组合框值填充文本框作为条件 [英] i want to fill textbox using combobox value as where condition

查看:64
本文介绍了我想使用组合框值填充文本框作为条件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么不对?

what is the wrong ??

try
 {
    SqlConnection con = new SqlConnection(@ "jjj");
    SqlCommand comm = new SqlCommand("select [??????_??????] from client where [???   _??????]= '" + comboBox1.SelectedValue + "' ", con);
   con.Open();
   prevtxt.Text =(string)comm.ExecuteScalar();
   con.Close();
 }
 catch (System.Exception ex)
 {
   MessageBox.Show(ex.Message);
  }

推荐答案

您的文本框需要处于活动状态多行,并且在关注时刻使用+ =并且不要仅使用=
your textbox need be active multiline and in the moment of asigment use the += and don''t use only =


这篇关于我想使用组合框值填充文本框作为条件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆