如果我想搜索req_ser ,req_year .. ,so on fields
我执行以下操作:
if (obj.RequestSerial != 0)
{
if (condition != "")
condition = condition + " AND ";
condition += " req_ser= " + obj.RequestSerial;
}
if (obj.RequestYear != 0)
{
if (condition != "")
condition = condition + " AND ";
condition += " req_year = " + obj.RequestYear;
}
然后在我的选择语句中,我执行以下操作:
SELECT * FROM .... WHERE ..... + condition
如何使用与 LINQ TO SQL 实体相同的概念进行搜索?