MS SQL Server
  Home arrow MS SQL Server arrow Working with T-SQL Stored Procedures using...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Dedicated Servers 
Actuate Whitepapers 
Moblin 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
MS SQL SERVER

Working with T-SQL Stored Procedures using ADO.NET
By: Jagadish Chaterjee
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 17
    2006-04-11

    Table of Contents:
  • Working with T-SQL Stored Procedures using ADO.NET
  • How to execute a simple stored procedure using ADO.NET from ASP.NET
  • How to execute a stored procedure with a single parameter using ADO.NET from ASP.NET
  • How to execute a stored procedure with multiple parameters using ADO.NET from ASP.NET

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    Working with T-SQL Stored Procedures using ADO.NET


    (Page 1 of 4 )

    In this series, I shall try to remove all kinds of confusion about calling stored procedures from within ADO.NET. I shall also explain how to write your own stored procedures and execute them from within ADO.NET. I start with the simplest and end with the most advanced way of executing the stored procedures.
    A downloadable file for this article is available here.

    Every programmer knows that stored procedures play a great role in developing multi-tier applications.  Most of the experienced programmers work with stored procedures in a traditional fashion, and I agree that it really works.  

    But the technology has greatly improved from our traditional methods. Now we face several of the latest standards like XML, web services, external routines, and so on.  I bet not every programmer uses all of them in developing their applications. 

    In this series, I wanted to start with the simplest traditional way of working with stored procedures.  Gradually, I will add a few more series (all tying into one another) to work with most advanced trends in working with stored procedures.

    But at this moment, this article focuses on the basics of stored procedures and how to call them from ADO.NET.  I included the source code in the form of a single file (".zip" file).  You need to extract the folders from the zip and configure the virtual directories on your own. 

    For the sake of this demonstration, I created two tables, "emp" and "dept," within the "Northwind" database.  The "emp" table has been created with the following column structure:

    Empno (int)
    Ename (varchar)
    Sal (float)
    Deptno (int)

    Similarly, I have the "dept" table with the following structure:

    Deptno (int)
    Dname (varchar)
    Location (varchar)

    I ask that you create those two tables, as all of the stored procedures in this article are heavily dependent on the above two tables.

    More MS SQL Server Articles
    More By Jagadish Chaterjee


       · Hello guys. Enjoy the first in series reg. SQL Server Stored Procedures and...
     

    MS SQL SERVER ARTICLES

    - Completing the Introduction to Transact-SQL
    - A Brief Introduction to Transact-SQL
    - Lookups and Blocking Bad Data
    - Field Validation Rules for Blocking Bad Data
    - Using Masks to Block Bad Data
    - Blocking Bad Data
    - Using @@ROWCOUNT and TABLE Variables for Dat...
    - How to Use Variables, IF and CASE in Databas...
    - Creating Important Aspects of Notification S...
    - Working wth Variables in Database Interactio...
    - Delving Deeper into Notification Services
    - Notification Services
    - Building a Multi-table Report with SQL 2005 ...
    - A Secure Way of Building Connection Strings
    - Transferring a Database Using the SSIS Desig...




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway