本文介绍了像命令一样的asp.net查询不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
dr = MYDBConnection.ExecuteReader_Query(@"select IE_VECHICLE_CODE from IE_VECHICLE_MASTER where VEHICLE_MAKE='"+objDetails.VechicleMake+"' and VEHICLE_MODEL='"+objDetails.VechicleModel+"' and VEHICLE_SUBTYPE like '"+objDetails.VechicleSubtype+"'");
我想为objDetails.VechicleSubtype写一个类似的命令,任何人都可以帮助我.
但是我在查询中变得很像
i want to write a like command for objDetails.VechicleSubtype could any one help me.
but i am getting like in query
select IE_VECHICLE_CODE from IE_VECHICLE_MASTER where VEHICLE_MAKE='MARUTI' and VEHICLE_MODEL='SWIFT' and VEHICLE_SUBTYPE like '%'LXI'%'
adv致谢,
Rahul.
Thanks and Regards in adv,
Rahul.
推荐答案
SELECT * FROM MyTable WHERE UserName LIKE '%fred%'
将返回:
fred
alfred
freda
hello, my name is fred the dwarf warrior
dr = MYDBConnection.ExecuteReader_Query(@"select IE_VECHICLE_CODE from IE_VECHICLE_MASTER where VEHICLE_MAKE='"+objDetails.VechicleMake+"' and VEHICLE_MODEL='"+objDetails.VechicleModel+"' and VEHICLE_SUBTYPE like '%"+objDetails.VechicleSubtype+"%'");
这篇关于像命令一样的asp.net查询不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!