日期:2014-05-19  浏览次数:20414 次

初学者问题
一个按钮,一个TextBox,单击按钮时把TextBox内容从数据库里搜出来,搜索整个数据库的,,

------解决方案--------------------
1、查询出数据 (select value from table)
2、将数据赋值给textbox this.txtbox.text = datatable.rows[0][ "value "].ToString()
------解决方案--------------------
首先点击按钮后!按钮时间中要链接数据库!然后打开数据库
用SQLCOmmand cmd = new SQLCOmmand( "select * from 你的数据表 where 你的条件 ")
然后执行!
this.Textbox1.text = 你取出来的东西!
OK了!
------解决方案--------------------
"select * from tablename where textbox= ' "+textbox.Text+ " ' "