Retrieving Scalar Data from a Stored Procedure

Tuesday Jul 5th 2005 by Staff

Stored procedures typically return resultsets, but sometimes it can be useful to just retrieve scalar data. This article looks at the various ways to get scalar data back from a SQL Server stored procedure and how to access the returned data in your ASP.NET code.


Virtually all ASP.NET applications of interest work with database data at some level, and one of the most common databases used in ASP.NET applications is Microsoft's own SQL Server database. With relational databases like SQL, commands are issued through the SQL syntax, which includes SELECT, INSERT, UPDATE, and DELETE statements, among others. One way to issue a command to a database from an ASP.NET application is to craft the SQL query in the application itself. Such queries are often called ad-hoc queries. The primary downside of ad-hoc queries is that they are hard to maintain - if you need to change your query you need to edit the string in your application, recompile, and redeploy.

The article continues at

Mobile Site | Full Site
Copyright 2017 © QuinStreet Inc. All Rights Reserved