I am using Microsoft access 2007 as a database. I want to pass parameter for TOP keyword. i am using this code. i am passing txtQ1.Text as a parameter for TOP keyword but this give error.. could you please tell me the correct way to do that?? I am getting this error message.ERROR MESSAGE :"The SELECT statement includes a reserved word or an argument name that is misspelled or missing, or the punctuation is incorrect."<pre lang="c#">OleDbConnection con7 = new OleDbConnection();con7.ConnectionString = ConfigurationSettings.AppSettings["connecti"];con7.Open();OleDbCommand cmd7 = new OleDbCommand("delete ProductEntery FROM(select TOP @q * from ProductEntery)AS t1 where Produc_Name = @yo", con7);cmd7.Parameters.Add(new OleDbParameter("@yo", txtname1.Text));cmd7.Parameters.Add(new OleDbParameter("@q", txtQ1.Text));cmd7.ExecuteNonQuery();con7.Close();</pre> 解决方案 这篇关于使用TOP关键字删除语句(如何传递参数?)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
09-16 10:09