~今天老遇怪事~该如何处理
~~~~~今天老遇怪事~~~~
方法如下 参数是(1) select * from anlv_pro where pro_type='卧式机' and pro_name like '*11*'
(2)table1
用的access 数据库中有数据~~~~
为什么我读不到??????
------解决方案--------------------
是不是条件这里空格问题啊。
pro_type= '卧式机 '
------解决方案--------------------
报错误吗?
看看你Catch到什么错误没有
------解决方案--------------------
空格问题!
------解决方案--------------------
你用的ORACAL吧? 空格问题啊。。
------解决方案--------------------
select * from anlv_pro where pro_type= '卧式机 ' and pro_name like "*"+你的变量+"*";
通配符不能和变量写一起
------解决方案--------------------
select * from anlv_pro where pro_type= '卧式机 ' and pro_name like '%11%'
------解决方案--------------------
[code=C#][/code]123
------解决方案--------------------
456
------解决方案--------------------
789
方法如下 参数是(1) select * from anlv_pro where pro_type='卧式机' and pro_name like '*11*'
(2)table1
- C# code
public static DataSet ExecuteTextRet(string cmdText, string TableName) { DataSet ds = new DataSet(); OleDbDataAdapter adp = new OleDbDataAdapter(); OleDbCommand cmd = new OleDbCommand(); try { PrepareCommand(cmd, CommandType.Text, cmdText); try { adp.SelectCommand = cmd; adp.Fill(ds, TableName); return ds; } catch (OleDbException e) { throw (new Exception(e.Message)); } } catch (Exception ex) { throw ex; } finally { DisposeCmd(cmd); } }
用的access 数据库中有数据~~~~
为什么我读不到??????
------解决方案--------------------
是不是条件这里空格问题啊。
pro_type= '卧式机 '
------解决方案--------------------
报错误吗?
看看你Catch到什么错误没有
------解决方案--------------------
空格问题!
------解决方案--------------------
你用的ORACAL吧? 空格问题啊。。
------解决方案--------------------
select * from anlv_pro where pro_type= '卧式机 ' and pro_name like "*"+你的变量+"*";
通配符不能和变量写一起
------解决方案--------------------
select * from anlv_pro where pro_type= '卧式机 ' and pro_name like '%11%'
------解决方案--------------------
[code=C#][/code]123
------解决方案--------------------
456
------解决方案--------------------
789