CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> Tips & Solutions

 Execute a Stored procedure in .Net / DAO

Print topic Send  topic

Author Message
klipkop

Posts: 16
Posted: 07/09/2007, 2:37 PM

There are a lot of posts around executing your own stored procedure which are very confusing. After hours of trying different combinations here is my code - that works - for .net


The code is for C# using DAO as connection type
Code to change is in UPPERCASE

// Use existing data connection
DataAccessObject NewDao = Settings.YOURCONNECTIONNAMEDataAccessObject;

// declare and set your variables that the SP needs - this gets it from the URL
int @PARAMETER1 = Int32.Parse(Request.QueryString["VARIABLE1"]);
int @PARAMETER2= Int32.Parse(Request.QueryString["VARIABLE2"]);

// Execute the SP the EXEC I think must be in Uppercase?
string sSql = "EXEC STOREDPROCEDURENAME " + @PARAMETER1+","+@PARAMETER2;
NewDao.ExecuteReader(sSql);

Thats it - and it works

View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.