Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Lid 是 ms 访问中的自动编号字段。错误消息:查询表达式“Lid=”中缺少(运算符)
db.Search_Grid_Add(LoanInfo_dgv, "Select * From Loan_Info Where Lid=" + LoanId_cb.Text + "");
也许LoanId_cb.Text不被解析为int?尝试:
LoanId_cb.Text
int lid; string lidText = LoanId_cb.Text.Trim(); if(int.TryParse(lidText , out lid)) { db.Search_Grid_Add(LoanInfo_dgv, "Select * From Loan_Info Where Lid="+lidText ); } else { MessageBox.Show(lidText + " can't be parsed as int."); }