当前位置:网站首页>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
边栏推荐
- Learning record of arouter principle
- Current market situation and development prospect forecast of the global fire boots industry in 2022
- 4 years of experience to interview test development, 10 minutes to end, ask too
- 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
- Thesis reading_ Chinese NLP_ ELECTRA
- Symbol of array element product of leetcode simple problem
- 【SQL注入】联合查询(最简单的注入方法)
- Internationalization and localization, dark mode and dark mode in compose
- [tools run SQL blind note]
- Integration of Android high-frequency interview questions (including reference answers)
猜你喜欢

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
![[PCL self study: filtering] introduction and use of various filters in PCL (continuously updated)](/img/36/53886b9d3b98f744be2b6aa6b5d3eb.jpg)
[PCL self study: filtering] introduction and use of various filters in PCL (continuously updated)

Two drawing interfaces - 1 Matlab style interface

【工具跑SQL盲注】

Career planning of counter attacking College Students

Concurrent operation memory interaction

LVS load balancing cluster of efficient multi-purpose cluster (NAT mode)

Internationalization and localization, dark mode and dark mode in compose

Basic use of Metasploit penetration testing framework

Handling record of electric skateboard detained by traffic police
随机推荐
[set theory] relational representation (relational matrix | examples of relational matrix | properties of relational matrix | operations of relational matrix | relational graph | examples of relationa
M1 Pro install redis
Truncated sentences of leetcode simple questions
"Niuke brush Verilog" part II Verilog advanced challenge
Crazy scientist
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
[PCL self study: filtering] introduction and use of various filters in PCL (continuously updated)
MC Layer Target
Basic use of Metasploit penetration testing framework
[set theory] binary relationship (binary relationship notation | binary relationship from a to B | number of binary relationships | example of binary relationship)
Market status and development prospect forecast of global button dropper industry in 2022
The programmer went to bed at 12 o'clock in the middle of the night, and the leader angrily scolded: go to bed so early, you are very good at keeping fit
The process of browser accessing the website
Web security - CSRF (token)
document. The problem of missing parameters of referer is solved
Market status and development prospects of the global automatic tea picker industry in 2022
论文阅读_中文医疗模型_ eHealth
【PHP漏洞-弱类型】基础知识、php弱相等、报错绕过
Number of 1 in binary (simple difficulty)
The usage of micro service project swagger aggregation document shows all micro service addresses in the form of swagger grouping