var tmpTable = dt.Select("strText IN('" + strZipList + "')");
if (tmpTable.Any())
{
dt = tmpTable.CopyToDataTable();
}
DT = DataTable,並 strText中是類型的string
strZipList =串( '1', '2',....等)爲什麼dataTable.Select總是返回空結果?
編輯: 數據表結構創建爲:
private DataTable CreateListTabel()
{
DataTable _dtList = new DataTable();
DataColumn dc1 = new DataColumn("strText", typeof(String));
DataColumn dc2 = new DataColumn("strValue", typeof(String));
DataColumn dc3 = new DataColumn("isSelected", typeof(Boolean));
DataColumn dc5 = new DataColumn("intSrNo", typeof(Int32));
DataColumn dc6 = new DataColumn("intID", typeof(Int32));
DataColumn dc7 = new DataColumn("isExcluded", typeof(Boolean));
DataColumn dc8 = new DataColumn("isDisabled", typeof(Boolean));
_dtList.Columns.Add(dc1);
_dtList.Columns.Add(dc2);
_dtList.Columns.Add(dc3);
_dtList.Columns.Add(dc5);
_dtList.Columns.Add(dc6);
_dtList.Columns.Add(dc7);
_dtList.Columns.Add(dc8);
_dtList.AcceptChanges();
return _dtList;
}
哪裏出問題了?
我們需要你有什麼數據 – ericosg
strText中必須被推斷爲變量,我想更多的信息,但它作爲一個字符串。只是從第一個觀察 – Tushar
觀察什麼是strText? –