Home > Database > Mysql Tutorial > access自动编号,标准表达式中数据类型不匹配

access自动编号,标准表达式中数据类型不匹配

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 15:39:02
Original
2066 people have browsed it

自己想做一个在文本框输入留言的 编号 (ID),来查询留言内容的功能, 但access中 自动 编号 的 标准 表达式 中 数据 类型 不 匹配 所拦住,经过分析,查看资料,自己找到了一个解决方法,在这里 分享一下 文本框的名字为txtyhid //将如果写成 //String sql =

自己想做一个在文本框输入留言的编号(ID),来查询留言内容的功能,

但access中自动编号标准表达式数据类型匹配所拦住,经过分析,查看资料,自己找到了一个解决方法,在这里分享一下

文本框的名字为txtyhid


//将如果写成

//String sql = "select * from yhly where lyr=" + txtyhcx.Text+"'";

//或者进行整形转换String sql = "select * from yhly where lyr=" +int.Parse( txtyhcx.Text)+"'";

//或者进行长整形转换


本人的解决方案,将自动编号的SQL语句分解开

String sql = "select * from yhly where ID=";

         String sql1 = sql + txtyhid.Text;



Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
Access error using alias
From 1970-01-01 08:00:00
0
0
0
Single module access
From 1970-01-01 08:00:00
0
0
0
About Mac MAMP PRO deploy thinkphp5.1 access 404
From 1970-01-01 08:00:00
0
0
0
My access page reports 403
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template