当前位置:网站首页>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
边栏推荐
- Games101 Lesson 9 shading 3 Notes
- [tools run SQL blind note]
- The reason why the entity class in the database is changed into hump naming
- Thesis reading_ ICD code_ MSMN
- 2022 chemical automation control instrument examination summary and chemical automation control instrument certificate examination
- stm32逆向入门
- The process of browser accessing the website
- Triangular rasterization
- 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
- [XSS bypass - protection strategy] understand the protection strategy and better bypass
猜你喜欢

带有注意力RPN和多关系检测器的小样本目标检测网络(提供源码和数据及下载)...

STM32 reverse entry

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

Esp32-c3 learning and testing WiFi (II. Wi Fi distribution - smart_config mode and BlueIf mode)

【工具跑SQL盲注】

String matching: find a substring in a string

Apache MPM model and ab stress test

MPM model and ab pressure test

Learning practice: comprehensive application of cycle and branch structure (I)

Leetcode simple question: check whether the array is sorted and rotated
随机推荐
Pyqt control part (II)
2022 a special equipment related management (elevator) analysis and a special equipment related management (elevator) simulation test
Uipath practice (08) - selector
Market status and development prospects of the global autonomous marine glider industry in 2022
[set theory] binary relation (example of binary relation operation | example of inverse operation | example of composite operation | example of limiting operation | example of image operation)
Esp32-c3 learning and testing WiFi (II. Wi Fi distribution - smart_config mode and BlueIf mode)
联发科技2023届提前批IC笔试(题目)
UiPath实战(08) - 选取器(Selector)
The current market situation and development prospect of the global gluten tolerance test kit industry in 2022
sql语句模糊查询遇到的问题
Apache MPM model and ab stress test
STM32 reverse entry
Introduction to message queuing (MQ)
文献阅读_基于多模态数据语义融合的旅游在线评论有用性识别研究(中文文献)
Keepalived热备与HAProxy
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
[set theory] binary relationship (definition field | value field | inverse operation | inverse synthesis operation | restriction | image | single root | single value | nature of synthesis operation)
Thesis reading_ Tsinghua Ernie
MediaTek 2023 IC written examination approved in advance (topic)
I've seen a piece of code in the past. I don't know what I'm doing. I can review it when I have time