当前位置:网站首页>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
边栏推荐
- Shell script Basics - basic grammar knowledge
- [USACO 2009 Dec S]Music Notes
- Wechat applet distance and map
- 2022 registration of G2 utility boiler stoker examination and G2 utility boiler stoker reexamination examination
- 联发科技2023届提前批IC笔试(题目)
- Notes | numpy-08 Advanced index
- On typescript and grammar
- Games101 Lesson 9 shading 3 Notes
- Silent authorization login and registration of wechat applet
- 2022 tea master (intermediate) examination questions and tea master (intermediate) examination skills
猜你喜欢
随机推荐
Shuttle + Alluxio 加速内存Shuffle起飞
JDBC database operation
Notes | numpy-09 Broadcast
Retirement plan fails, 64 year old programmer starts work again
2022 registration of G2 utility boiler stoker examination and G2 utility boiler stoker reexamination examination
2022 P cylinder filling test content and P cylinder filling simulation test questions
Market status and development prospects of the global IOT active infrared sensor industry in 2022
Caijing 365 stock internal reference: what's the mystery behind the good father-in-law paying back 50 million?
LVS load balancing cluster of efficient multi-purpose cluster (NAT mode)
Web security - CSRF (token)
Symbol of array element product of leetcode simple problem
[PCL self study: filtering] introduction and use of various filters in PCL (continuously updated)
Wechat applet waterfall flow and pull up to the bottom
Shell script -- condition judgment
[PHP vulnerability weak type] basic knowledge, PHP weak equality, error reporting and bypassing
Notes | numpy-10 Iterative array
2022 a special equipment related management (elevator) analysis and a special equipment related management (elevator) simulation test
Esp32-c3 learning and testing WiFi (II. Wi Fi distribution - smart_config mode and BlueIf mode)
On typescript and grammar
Thesis reading_ Chinese medical model_ eHealth