在C#winfrom中按名称,地址,联系电话号码搜索客户 [英] Search customer by name, address, contact number in C# winfrom

查看:118
本文介绍了在C#winfrom中按名称,地址,联系电话号码搜索客户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

I try my code for name search it works but I don't know how to add more than one search query so anyone please help 

<pre lang="c#"> Command.CommandText = @"SELECT * FROM PersonalINFO  WHERE (FirstName = '" + Search.Text + "'  )";









我尝试过:







What I have tried:

my searching query by only name is above how can I use Phone number or email address find people from my client database any one of this into search box 

推荐答案

您必须使用 SQL AND&或运营商 [ ^ ]。

最重要的是,你是直接将用户输入注入到sql查询中,必须避免这样做,因为它有风险 SQL注入 [ ^ ]
You have to use SQL AND & OR Operators[^].
Most important of all, you are injecting user inputs into the sql query directly, that must be avoided as it risks SQL Injection[^]


这篇关于在C#winfrom中按名称,地址,联系电话号码搜索客户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆