StringBuilder sb = new StringBuilder();
DataTable mytable = (DataTable)ViewState["table"];
sb.Append(string.Format(" kp_henly_code like '%{0}%'", TextBox1.Text.Trim()));
sb.Append(string.Format(" and kp_sup_name like '%{0}%' ", TextBox2.Text.Trim()));
sb.Append(string.Format(" and kp_item_name like '%{0}%' ", TextBox3.Text.Trim()));
sb.Append(string.Format(" and kp_branch_no like '%{0}%' ", TextBox4.Text.Trim()));
DataRow[] row = mytable.Select(sb.ToString());
DataTable copytable = mytable.Clone();
for (int i = 0; i <= row.Length - 1; i++)
{
copytable.ImportRow((DataRow)row[i]);
}
datarow 转化为datatable
最新推荐文章于 2021-11-30 15:48:00 发布