请大家帮忙看下,在这种情况下,我下面的语句哪里需要修改,总是提示我有一个参数未指定?
还有顺便问下,如果在ACCESS中数据类型为备注,那么在ASP.NET中oledbtype选择何种对应数据类型?
s = txt1.text.trim();
conn.Open();
OleDbDataAdapter oda = new OleDbDataAdapter("select NewsID,Title,Author,UpdateTime,click from cynews where Title like '%'+@s+'%'", conn);
OleDbParameter para = new OleDbParameter("@s",OleDbType.VarChar,100);
para.Value = s;
oda.GetFillParameters();
DataSet ds = new DataSet();
int n = oda.Fill(ds);
this.gvSearchTitle.DataSource = ds;
this.gvSearchTitle.DataBind();
conn.Close();
还有顺便问下,如果在ACCESS中数据类型为备注,那么在ASP.NET中oledbtype选择何种对应数据类型?
s = txt1.text.trim();
conn.Open();
OleDbDataAdapter oda = new OleDbDataAdapter("select NewsID,Title,Author,UpdateTime,click from cynews where Title like '%'+@s+'%'", conn);
OleDbParameter para = new OleDbParameter("@s",OleDbType.VarChar,100);
para.Value = s;
oda.GetFillParameters();
DataSet ds = new DataSet();
int n = oda.Fill(ds);
this.gvSearchTitle.DataSource = ds;
this.gvSearchTitle.DataBind();
conn.Close();
解决方案 »
- 急!急!急!急!急!asp.net 网页。 图片区域提示效果,像地图一样的那种。
- 为什么VS2005 SP1的安装时间远远大于VS2005本身的安装时间?我是从微软官方下的SP1补丁?无敌困惑
- 正则表达式的问题。
- 为什么连接不到数据库?!!?
- 首页中加入登陆按钮的问题
- 朋友们,选择DropDownList中相应的省,但另外一个DropDownList只有这个省的城市,这怎么做呢,不从数据中读取。
- 开发项目中遇到几个奇怪的问题.求解!
- 放假没事写了个基类库...请高手指点...
- 问个ASP。NET中关于用户控件的问题?
- 移动终端、软件系统、服务器关系
- 求一个网页播放器(要能限制播放次数)
- .net 怎样可以替代frame框架(在线等)
OleDbParameter para = new OleDbParameter("@s",OleDbType.VarChar);
para.Value = '%'+s+'%';
OleDbParameter para = new OleDbParameter("@s",OleDbType.VarChar);
para.Value = "%"+s+"%";
这句也应该改为
oda.SelectCommand.Parameters.Add(para);谢谢大家