当前位置:网站首页>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
边栏推荐
- Current market situation and development prospect prediction of global direct energy deposition 3D printer industry in 2022
- Uipath practice (08) - selector
- Two drawing interfaces - 1 Matlab style interface
- Leetcode simple question: the key with the longest key duration
- Leetcode simple question: check whether the array is sorted and rotated
- 【XSS绕过-防护策略】理解防护策略,更好的绕过
- The simple problem of leetcode: dismantling bombs
- Review the configuration of vscode to develop golang
- I've been in software testing for 8 years and worked as a test leader for 3 years. I can also be a programmer if I'm not a professional
- 2022 t elevator repair simulation examination question bank and t elevator repair simulation examination question bank
猜你喜欢

Leetcode simple question: check whether the array is sorted and rotated

Learn to use the idea breakpoint debugging tool

Mobile terminal - uniapp development record (public request encapsulation)

2022 registration examination for safety production management personnel of hazardous chemical production units and examination skills for safety production management personnel of hazardous chemical

【XSS绕过-防护策略】理解防护策略,更好的绕过

MC Layer Target

7. Integrated learning

《牛客刷verilog》Part II Verilog进阶挑战

并发操作-内存交互操作

On typescript and grammar
随机推荐
sql语句模糊查询遇到的问题
Summary of training competition (Lao Li's collection of questions)
2022 new examination questions for the main principals of hazardous chemical business units and examination skills for the main principals of hazardous chemical business units
Market status and development prospect prediction of the near infrared sensor industry of the global Internet of things in 2022
Two drawing interfaces - 1 Matlab style interface
Priv app permission exception
Market status and development prospect prediction of the global forward fluorescent microscope industry in 2022
移动端——uniapp开发记录(公共请求request封装)
C primre plus Chapter 10 question 6 inverted array
Hj35 serpentine matrix
Market status and development prospect prediction of the global autonomous hybrid underwater glider industry in 2022
Market status and development prospect prediction of global neutral silicone sealant industry in 2022
2022 t elevator repair simulation examination question bank and t elevator repair simulation examination question bank
M1 Pro install redis
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
Sprintf formatter abnormal exit problem
Prepare for 2022 and welcome the "golden three silver four". The "summary of Android intermediate and advanced interview questions in 2022" is fresh, so that your big factory interview can go smoothly
Notes | numpy-10 Iterative array
Shuttle + Alluxio 加速内存Shuffle起飞
[set theory] binary relationship (special relationship type | empty relationship | identity relationship | global relationship | divisive relationship | size relationship)