我想过滤一个 Datatable 并且它可以工作,但是如果我搜索一个 DateTime 我会得到一个错误。
这是我的代码。我做错了什么?
DataTable tb = DataBaseManager.GetRadiusDataTable(radiusconnectionstring, "marksullivan");
DataRow[] filteredRows = tb.Select("AcctStartTime LIKE '%" + searchstring + "%' OR AcctStopTime LIKE '%" + searchstring + "%' OR FramedIPAddress LIKE '%" + searchstring + "%'");
tb = filteredRows.CopyToDataTable();
this.ListView.DataSource = tb;
this.ListView.DataBind();
AcctStartTime:datetime AcctStopTime :datetime FramedIPAddress : varchar
The error: The Operation 'Like' could not to System.DateTime and System.String execute.
我怎样才能做到这一点?