在ASP中编写存储过程 [英] Writing a stored Procedure in ASP

查看:65
本文介绍了在ASP中编写存储过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我有一个名为contacts的数据库。我编写了一个存储过程来计算行数,例如:

Hello people,

I have a database with table called "contacts". I have written a stored procedure to count the number of rows some thing like this :

ALTER PROCEDURE countentries
	/*
	(
	@parameter1 int = 5,
	@parameter2 datatype OUTPUT
	)
	*/
AS
select Name ,Count(*) As Count from contacts
group by Name 
	/* SET NOCOUNT ON */
	RETURN



现在我将此分配给 SqlDataSource


Now I assign this to the SqlDataSource:

SelectCommandType="StoredProcedure" SelectCommand="countentries"



该页面给我一个错误说:


The page gives me an error saying :

A field or property with the name 'Contact' was not found on the selected data source.



谢谢


Thanks

推荐答案

检查您的绑定:您可能链接到联系人而不是联系人 - 错误消息中的名称是单数,存储过程中的名称是复数。
Check your bindings: it's possible you are linking to "Contact" instead of "Contacts" - the name in the error message is singular, the name in the stored procedure is plural.


这篇关于在ASP中编写存储过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆