Mega Code Archive
Categories
/
ASP.Net Tutorial
/
ADO Net Database
Use a SqlParameter to represent stored procedure return values and output parameters
File: GetProductCount.sql CREATE PROCEDURE dbo.GetProductCount AS RETURN (SELECT COUNT(*) FROM Products) File: ShowProductCount.aspx <%@ Page Language="C#" %> <%@ Import Namespace="System.Data" %> <%@ Import Namespace="System.Data.SqlClient" %> <%@ Import Namespace="System.Web.Configuration" %>
Show Product Count
There are
products in the database.
File: Web.config