在ASP.NET中声明性地使用Delete命令的问题 [英] Problem in Declaratively using Delete Command in ASP.NET
本文介绍了在ASP.NET中声明性地使用Delete命令的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Hello People,
- 我使用了详细信息视图,以显示名为contacts的表中的数据,它有2列Contact和名称。
- 我使用过SQL数据源控件:像这样
SQLDATASOURCE控件:
Hello People,
- i have used a details view so as to display the data from my table named "contacts" it has 2 columns "Contact" and "Name".
- I have used an SQL data source control: like this
SQLDATASOURCE control:
<asp:SqlDataSource ID="sql" runat="server" ConnectionString="<%$ ConnectionStrings:contacts %>" UpdateCommand="update contacts set Name=@Name where Contact=@Contact" DeleteCommand="Delete from contacts where Contact=@Contact " InsertCommand="Insert into contacts (Name,Contact) values(@Name,@Contact)" SelectCommand="select Name,Contact from contacts" />
因此在运行此页面后出现错误:
必须声明标量变量@Contact。
亲切的建议
谢谢,
So after running this page i get an error :
Must declare the scalar variable "@Contact".
Kindly Advice
Thanks,
推荐答案
ConnectionStrings:contacts%>UpdateCommand =update contacts set Name = @ Name where contact = @ ContactDeleteCommand =从联系人中删除联系人= @联系人InsertCommand =插入联系人(姓名,联系方式)值(@姓名,@联系人)SelectCommand =选择姓名,联系人联系人/>
ConnectionStrings:contacts %>" UpdateCommand="update contacts set Name=@Name where Contact=@Contact" DeleteCommand="Delete from contacts where Contact=@Contact " InsertCommand="Insert into contacts (Name,Contact) values(@Name,@Contact)" SelectCommand="select Name,Contact from contacts" />
所以在运行此页面后我收到一个错误:
必须声明标量变量@Contact。
亲切的建议
谢谢,
So after running this page i get an error :
Must declare the scalar variable "@Contact".
Kindly Advice
Thanks,
这篇关于在ASP.NET中声明性地使用Delete命令的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文