这是我对 wpf 表单的查询
Query = "select Cust_Id,Card_Number,Clients_Title,Address_Current,Phone_Number,Mobile_Number from Customer_New Where 1=1";
try
{
if (txt_title.Text != "")
Query += " and Clients_Title Like '%" + txt_title.Text + "%'";
if (txt_address.Text != "")
Query += " and Address_Current Like '%" + txt_address.Text + "%'";
if (txt_phone.Text != "")
Query += " and Phone_Number Like '%" + txt_phone.Text + "%'";
if (txt_mobile.Text != "")
Query += " and Mobile_Number Like '%" + txt_mobile.Text + "%'";
if (cbo_location.Text != "")
Query += " and AreaLocation Like '%" + cbo_location.Text + "%'";
}
catch { }
我想报告查看器查询数据,例如我的 wpf 表单。这是我在报表查看器中尝试的查询
SELECT Cust_Id, Clients_Title, Card_Number, Key_Person, Address_Current, Phone_Number, Mobile_Number, AreaLocation
FROM Customer_New
WHERE (Clients_Title = @Clients_Title) OR
(Address_Current = @Address_Current) OR
(Phone_Number = @Phone_Number) OR
(Mobile_Number = @Mobile_Number) OR
(AreaLocation = @AreaLocation)
谁能告诉我像 wpf form 这样的报表查看器查询。笔记 :-
- 我不能在报表查看器中使用不能使用 C# 控件。在报表查看器中我只能使用 sql
报表查看器查询需要的是:
当 where 子句的所有字符串都为空时,我的报表查看器
应该选择查询是:Query = "从 Customer_New 中选择 Cust_Id,Card_Number,Clients_Title,Address_Current,Phone_Number,Mobile_Number ";
当 where 子句的任意两个字符串与对应的行 db 不匹配时,则什么都没有
将显示
- 最后,如果仅提供 where 子句的一个条件,将进行选择