在此代码中:
string sql = "SELECT * FROM rd_main WHERE manifest!=\"\" AND manifest IS NOT NULL";
string tableName = "rd_main";
conn.Open();
SqlDataAdapter da = new SqlDataAdapter(sql, conn);
DataSet ds = new DataSet();
da.Fill(ds, tableName);
我一直在:
Cannot use empty object or column names. Use a single space if necessary.
da.Fill(...)上的
我试过了:
SELECT rd_main.* FROM rd_main WHERE rd_main.manifest<>"" AND rd_main.manifest IS NOT NULL
我做错了什么?
答案 0 :(得分:6)
你想要单引号,而不是双引号。
string sql = "SELECT * FROM rd_main WHERE manifest!='' AND manifest IS NOT NULL";
答案 1 :(得分:0)
SELECT * FROM rd_main WHERE manifest!=''AND manifest IS NOT NULL