当前位置:网站首页>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
边栏推荐
- 文献阅读_基于多模态数据语义融合的旅游在线评论有用性识别研究(中文文献)
- ZABBIX monitoring of lamp architecture (2): ZABBIX basic operation
- STM32 reverse entry
- String matching: find a substring in a string
- Leetcode simple problem delete an element to strictly increment the array
- 2022 registration examination for safety production management personnel of hazardous chemical production units and examination skills for safety production management personnel of hazardous chemical
- MediaTek 2023 IC written examination approved in advance (topic)
- 消息队列(MQ)介绍
- Basic use of Metasploit penetration testing framework
- Web security - CSRF (token)
猜你喜欢

Triangular rasterization

Interface frequency limit access

Mobile terminal - uniapp development record (public request encapsulation)

Pyqt control part (II)

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

2022 t elevator repair simulation examination question bank and t elevator repair simulation examination question bank

Basic use of Metasploit penetration testing framework

data2vec! New milestone of unified mode

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

Preparation for school and professional cognition
随机推荐
I stepped on a foundation pit today
Notes | numpy-10 Iterative array
C language self-made Games: Sanzi (tic tac toe chess) intelligent chess supplement
Silent authorization login and registration of wechat applet
Preparation for school and professional cognition
The process of browser accessing the website
移动端——uniapp开发记录(公共请求request封装)
Wechat applet waterfall flow and pull up to the bottom
data2vec! New milestone of unified mode
Learn to use the idea breakpoint debugging tool
Pyqt control part (II)
Notes | numpy-07 Slice and index
2022 chemical automation control instrument examination summary and chemical automation control instrument certificate examination
[BMZCTF-pwn] 18-RCTF-2017-Recho
[BMZCTF-pwn] 20-secret_ file
Thesis reading_ Chinese medical model_ eHealth
【工具跑SQL盲注】
JDBC database operation
Blog building tool recommendation (text book delivery)
Market status and development prospect prediction of global fermentation acid industry in 2022