当前位置:网站首页>Problems encountered in fuzzy query of SQL statements
Problems encountered in fuzzy query of SQL statements
2022-07-03 04:52:00 【CSDN Q & A】
The phenomenon and background of the problem
sql Statement fuzzy query cannot find data
Problem related code , Do not paste screenshots
StringBuilder sSelectSql =new StringBuilder( "select * from userInfo where 1=1"); List<SqlParameter> parameters = new List<SqlParameter>(); if (!string.IsNullOrEmpty(user.code)) { // Accurately query according to the user account sSelectSql.Append(" AND [email protected]"); parameters.Add(new SqlParameter("@code", user.code)); } if (!string.IsNullOrEmpty(user.name)) { // Fuzzy query input user name sSelectSql.Append(" AND [email protected]"); parameters.Add(new SqlParameter("@name", "%"+user.name+ "%")); }
Operation results and error reporting contents
Account search can be realized , But the name cannot be found
My solution ideas and tried methods
sql Is the sentence fuzzy and the query format wrong
What I want to achieve
Please help solve it
边栏推荐
- UiPath实战(08) - 选取器(Selector)
- 2022 Shandong Province safety officer C certificate examination content and Shandong Province safety officer C certificate examination questions and analysis
- 2.14 summary
- Market status and development prospect prediction of the global fire alarm sensor industry in 2022
- AWS VPC
- Market status and development prospects of the global autonomous marine glider industry in 2022
- 《牛客刷verilog》Part II Verilog进阶挑战
- [set theory] binary relationship (special relationship type | empty relationship | identity relationship | global relationship | divisive relationship | size relationship)
- Silent authorization login and registration of wechat applet
- [luatos sensor] 2 air pressure bmp180
猜你喜欢
Leetcode simple problem delete an element to strictly increment the array
Use Sqlalchemy module to obtain the table name and field name of the existing table in the database
Contents of welder (primary) examination and welder (primary) examination in 2022
2022 a special equipment related management (elevator) analysis and a special equipment related management (elevator) simulation test
Valentine's day limited withdrawal guide: for one in 200 million of you
关于开学的准备与专业认知
Number of uniform strings of leetcode simple problem
The programmer resigned and was sentenced to 10 months for deleting the code. JD came home and said that it took 30000 to restore the database. Netizen: This is really a revenge
Youdao cloud notes
Cross platform plug-in flutter for displaying local notifications_ local_ notifications
随机推荐
M1 Pro install redis
移动端——uniapp开发记录(公共请求request封装)
Games101 Lesson 9 shading 3 Notes
2022 tea master (intermediate) examination questions and tea master (intermediate) examination skills
Current market situation and development prospect prediction of global direct energy deposition 3D printer industry in 2022
[SQL injection] joint query (the simplest injection method)
document. The problem of missing parameters of referer is solved
Career planning of counter attacking College Students
Shuttle + Alluxio 加速内存Shuffle起飞
String matching: find a substring in a string
消息队列(MQ)介绍
Use Sqlalchemy module to obtain the table name and field name of the existing table in the database
On typescript and grammar
Learn to use the idea breakpoint debugging tool
论文阅读_中文医疗模型_ eHealth
Wechat applet waterfall flow and pull up to the bottom
2022 registration examination for safety production management personnel of hazardous chemical production units and examination skills for safety production management personnel of hazardous chemical
[PCL self study: filtering] introduction and use of various filters in PCL (continuously updated)
sql语句模糊查询遇到的问题
FISCO bcos zero knowledge proof Fiat Shamir instance source code