我想在我的DataTable
中搜索行。
我尝试过这样做:
protected void imggastsuche_Click(object sender, EventArgs e)
{
string searchstring = txtgastsuche.Text;
DataTable tb = DataBaseManager.GetDataTable(mysqlconnectionstring);
DataRow[] foundRows = tb.Select("FIRSTNAME,LASTNAME,NAME,COMPANY,TIMEFROM,TIMETO,CREATOR Like '%" + searchstring + "%'");
tb = foundRows.CopyToDataTable();
this.ListView.DataSource = tb;
this.ListView.DataBind();
}
但是我的字符串中出现了错误。
如果我想要在这些列中进行搜索,我该怎么办?
DataTable
/DataView
的一部分,所以你仍然会得到所有列。 - Tim Schmelter