TableAdapter中的参数表不被接受 [英] Paremeters in TableAdapter not accepted

查看:240
本文介绍了TableAdapter中的参数表不被接受的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我当前正在尝试设置TableAdapter,但是不允许我使用参数(这使它变得毫无用处)-当我创建新查询时

I'm currently trying to set up my TableAdapters, but it doesn't allow me to use parameters (what makes it quite useless) - When I create a new Query

SELECT     users.*
FROM         users
WHERE name LIKE @name

它告诉我'@' ...

我正在使用带有C#的VS08和使用OleDB-Driver的Access-Database

I'm using VS08 with C# and an Access-Database using OleDB-Driver

推荐答案

查看此处:

如何:创建参数化的TableAdapter查询

构造参数化时 查询,使用参数符号 特定于您的数据库 编码反对.例如,访问 和OleDb数据源使用 问号?"表示 参数,因此WHERE子句将 看起来像这样:WHERE City =?.

When constructing a parameterized query, use the parameter notation specific to the database you are coding against. For example, Access and OleDb data sources use the question mark '?' to denote parameters, so the WHERE clause would look like this: WHERE City = ?.

尝试将@替换为?并查看您的查询是否可以编译.

Try to substitute @ with ? and see if your query compiles.

这篇关于TableAdapter中的参数表不被接受的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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