还是搜索问题
this.Stxt=Request.Params["Stxt"].ToString();//这是页面传过来要查询的文本this.Threadid=Convert.ToInt32(Request.Params["typeid"]);//传过来的类型编号(在哪个论坛类型查)
OleDbConnection conn=new OleDbConnection(ConfigurationSettings.AppSettings["connectionString"]);
OleDbCommand cmd=new OleDbCommand("select * from Threads where typeid=@Threadid and subject Like '%@subject%'",conn);
cmd.Parameters.Add(new OleDbParameter("@Threadid",OleDbType.UnsignedInt));
cmd.Parameters["@Threadid"].Value=Threadid;
cmd.Parameters.Add(new OleDbParameter("@subject",OleDbType.LongVarChar));
cmd.Parameters["@subject"].Value=Stxt;
OleDbDataAdapter adp=new OleDbDataAdapter(cmd);
DataSet ds=new DataSet();
adp.Fill(ds,"Threads");
this.DataGrid1.DataSource=ds.Tables["Threads"].DefaultView;
this.DataGrid1.DataBind();
问题>输入要查询的文本,DataGrid1一条纪录也不显示,可在数据库里明明有.