473,653 Members | 2,990 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

variable parameters

hey all,
if i have a function that i'm passing the name of a stored procedure to and
i don't know if the stored procedure is going to have parameters or not
what's the perferred way to handle this or pass this?

thanks,
rodchar
Nov 8 '07 #1
2 1016
"rodchar" <ro*****@discus sions.microsoft .comwrote in message
news:33******** *************** ***********@mic rosoft.com...
if i have a function that i'm passing the name of a stored procedure to
and
i don't know if the stored procedure is going to have parameters or not
what's the perferred way to handle this or pass this?
List<SqlParamet erlstSqlParamet ers = new List<SqlParamet er>();

Inside the function, implement foreach on the lstSqlParameter s variable. If
it contains any, they'll be processed - if not, the rest of the function
will just continue...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Nov 8 '07 #2
thank you Mark for your help, i appreciate it.
rod.

"rodchar" wrote:
hey all,
if i have a function that i'm passing the name of a stored procedure to and
i don't know if the stored procedure is going to have parameters or not
what's the perferred way to handle this or pass this?

thanks,
rodchar
Nov 19 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
7908
by: Suzanne Vogel | last post by:
'stdarg.h' defines the 'va_arg' type to use in passing variable numbers of parameters to functions. The example of its use given in the Dinkumware documentation *seems* to imply that the 'va_arg' list should *automatically* be terminated with NULL past the user's last argument: http://www.dinkumware.com/manuals/reader.aspx?b=p/&h=stdarg.html However, I (for some reason) have to pass in the count of the number of arguments, or manually...
5
1913
by: Matt Clepper | last post by:
Any way to do this? I need to call functions based on a variable. Do I actually have to make a case statement and call each funciton explicitly, or is there any way to call a function where the funciton name is a variable. Example: dim variable as string variable = "thisfunction()" call variable <---this will not work
3
1443
by: Sunil Korah | last post by:
I dont know whether this is a stupid question. But does access have something akin to the pointer variable in C - or for that matter the '&' operator in xbase. I will explain my reason for wanting it too. I often use SQLs in which the where condition gets the data from a variable. e.g SELECT * from Customer WHERE CustID = strID
1
3676
by: Rob Wire | last post by:
Please let me know the preferred way to do the following. Accept a Variable in the calling page's URL of an ID. Set that variable to be global scope of the class so that it can be used throughout the functions from Page Load. Would like to send the ID variable as a SQL parameter to stored procedures for Select, Update, and Insert. What I have done so far to get around it is declare it in the SQL Select statements of the Web form code,...
2
2485
by: +The_Taco+ | last post by:
I already use session variable in my project to set a session timeout when the user doesn't do anything for 10 minutes. When I call other pages, I often use parameters in HREF link. I was wondering if it was better to pass parameter from page to page as session variable instead of doing it in HREF link? Thx for the hint !
3
6067
by: bennett.matthew | last post by:
Hello, Is there a good way to make PreparedStatements with a variable number of parameters? My queries look something like this: SET @rowid := null; SELECT * FROM ( SELECT
2
14429
by: vvenk | last post by:
Hello: I wrote a small program to insert a row into an Oracle Table: CREATE TABLE case_list (case_list_name_c VARCHAR2(100) NOT NULL, expiry_dt DATE NOT NULL, days_to_expire_n NUMBER(*,0), created_dt DATE DEFAULT SYSDATE, created_by_n NUMBER)
3
5610
by: Skip | last post by:
OK, I'm a novice in JS but have lots of coding experience. I am trying to accomplish something that would seem somewhat simple - BUT IT'S NOT. I have a basic window that calls another window with window.open and passes in 1 value using a querystring i.e., www.myhome.com/mypage?video=BAK-Extension Now when the window opens, I can capture the passed value in a JS function. But if I want to use that in the body of the HTML in a
1
2866
by: adz1809 | last post by:
I'm having a problem with updating a record through a form. Here is the error: Server Error in '/AccoEndUser' Application. -------------------------------------------------------------------------------- Must declare the variable '@Title'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
11
8310
by: Jef Driesen | last post by:
I have the following problem in a C project (but that also needs to compile with a C++ compiler). I'm using a virtual function table, that looks like this in the header file: typedef struct device_t { const device_backend_t *backend; ... } device_t; typedef struct device_backend_t {
0
8283
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8811
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8704
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7302
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6160
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5620
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4147
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4291
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2707
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.