我已执行上述查询,但出现错误:
{System.Data.OleDb.OleDbException: Syntax error. in query expression
'Select [UserID] from UserDetails'
我的示例代码如下:
OleDbCommand cmd1 = new OleDbCommand("Insert into UserCompanyDetails([UserID],[CompanyID]) values (" + "Select [UserID] from UserDetails" + "," + "Select @@identity" + ");", conn);
conn.Open();
cmd1.ExecuteNonQuery();
conn.Close();
为什么我会收到此错误?