0
我有一個簡單的選擇查詢其在Access工作正常,但不是在C#代碼 以下是訪問 查詢選擇查詢工作正常Access2010,但不是在C#代碼
SELECT FIRST(ItemName) As Item
from SubmitData
where ItemName like 'txt_rdo_breaks*'
and Deleted=false
下面是它的結果
但在C#代碼它retruns什麼 下面是C#代碼
cmd1.CommandText = "SELECT FIRST(ItemName) As Item from SubmitData where ItemName like 'txt_" + controlPatrs[0] + "*' and Deleted=false";
OleDbDataReader reader1 = cmd1.ExecuteReader(System.Data.CommandBehavior.Default);
while (reader1.Read())
{
if (Convert.ToString(reader1["Item"]).Length > 1)
{
tag += Convert.ToString(reader1["Item"]) + "|txt_" + controlPatrs[0] + "|" + controlPatrs[2] + "||";
}
}
reader1.Close();
將'Deleted = false'更改爲'Deleted = 0'。 – Mairaj
FIRST是MS Access獨有的。如果您將其更改爲MAX或其他功能,您會得到結果嗎? – smoore4
@MairajAhmad:還是一樣的 –