sql="select * from txt_search"
string index;
connect_sql_server(index);
改成
sql="select * from " + txt_search
connect_sql_server(sql);
試試看
key_txt 應該是指欄位名吧
改成下面樣試試
sql="select * from env104 where [" + key_txt + "] = '" + name_txt + "' "
不過這樣組 SQL 字串,要留意 SQL Injection 問題。