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" %>
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Show Product Count
File: Web.config
connectionString="Data Source=.\SQLEXPRESS;
AttachDbFilename=|DataDirectory|MyDatabase.mdf;Integrated Security=True;User Instance=True" />