K
karlid
hello,
In my asp.net projects I like to seperate the database connection and
lookups/executes from the code-behind pages using shared functions.
I find myself often using a function that returns a datatable given a
sql query and it works great. The function is contained in my
'dataaccess' class and is a shared function.
I would really like to do the same thing with stored procedures.
However, I'm running into problems handling the paramaters since there
can be zero or more and of varying types/names.
Ideally, the stored procedure's parameters can be defined in the
parameters of the function (using an array?) and then the stored
procedure is executed using the parameters within the function.
Does anyone have code for executing any stored procedure using a
generalized function? Is this even possible?
In my asp.net projects I like to seperate the database connection and
lookups/executes from the code-behind pages using shared functions.
I find myself often using a function that returns a datatable given a
sql query and it works great. The function is contained in my
'dataaccess' class and is a shared function.
I would really like to do the same thing with stored procedures.
However, I'm running into problems handling the paramaters since there
can be zero or more and of varying types/names.
Ideally, the stored procedure's parameters can be defined in the
parameters of the function (using an array?) and then the stored
procedure is executed using the parameters within the function.
Does anyone have code for executing any stored procedure using a
generalized function? Is this even possible?