求帮助,先查询然后再绑定到GridView的一条Select语句如何写
http://msdn.microsoft.com/zh-cn/library/system.web.ui.webcontrols.gridview(v=vs.110).aspx
我写成这样了,哪些要改 "select T_PhoneInfo.ID,T_PhoneInfo.Brand AS ID, productNumber,Brand,Unitprice,NetworkType,ScreenSize,System,Pixel from T_PhoneInfo where EXISTS (select *from T_PhoneInfo where Brand like '%" + SelectBox + "%' )"
string sql="select * from 表 where 条件";//诸如此类
然后通过ado.net(SqlDataAdapter填充数据集)获得DataTable对象
GridView.Datasource = Datatable.DefaultView;
GridView.Databind();//绑定即可
你应该先好好学习一下整个简单的流程怎么做,然后再深入到细节处理。http://blog.csdn.net/hello_world_wusu/article/details/4052844
这条SQL能够在数据库中调通吗?然后下面的这条sql,SelectBox是否应该取下它的Text呢?
select *from T_PhoneInfo where Brand like '%" + SelectBox + "%'
模糊查询不行,前面的可以