Fecthing Parameters from SQL Stored Procedure

  • Thread starter Thread starter Hendri Irawan
  • Start date Start date
H

Hendri Irawan

In ADO, there is a way to fetch parameters from stored
procedure into a Command object with
Command.Parameters.Refresh method. Is there any similar
method in ADO .NET ? Because my stored procedures have a
lots parameters and it's very ineffective adding it one by
one.
 
Hi Hendri,

You might use OleDbConnection.GetOleDbSchemaTable method to look into
parameters or some sort of native SQL DDL statement
However, it is better to programatically set them - inefficient is the way
you are looking for because it has to fetch them from dtb.
 
Hi Miha,

Thanks for your reply. I know that fetching parameters
from the db is very resource consuming (thus it is
inefficient). Usually i won't do that. But in my current
case, development time is very short, so our team must
find the easiest and fastest way to fetch those
parameters, each stored procedure contains an average of
35 parameters.

-----Original Message-----
Hi Hendri,

You might use OleDbConnection.GetOleDbSchemaTable method to look into
parameters or some sort of native SQL DDL statement
However, it is better to programatically set them - inefficient is the way
you are looking for because it has to fetch them from dtb.

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
SLODUG - Slovene Developer Users Group
www.rthand.com

In ADO, there is a way to fetch parameters from stored
procedure into a Command object with
Command.Parameters.Refresh method. Is there any similar
method in ADO .NET ? Because my stored procedures have a
lots parameters and it's very ineffective adding it one by
one.


.
 
Consider using a tool like CodeSmith to generate your wrapper code from
existing stored procs

Freeware and Pro versions available with sample templates that will do just
what you want.

http://www.EricJSmith.com/CodeSmith/

Hi Miha,

Thanks for your reply. I know that fetching parameters
from the db is very resource consuming (thus it is
inefficient). Usually i won't do that. But in my current
case, development time is very short, so our team must
find the easiest and fastest way to fetch those
parameters, each stored procedure contains an average of
35 parameters.

-----Original Message-----
Hi Hendri,

You might use OleDbConnection.GetOleDbSchemaTable method to look into
parameters or some sort of native SQL DDL statement
However, it is better to programatically set them - inefficient is the way
you are looking for because it has to fetch them from dtb.

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
SLODUG - Slovene Developer Users Group
www.rthand.com

In ADO, there is a way to fetch parameters from stored
procedure into a Command object with
Command.Parameters.Refresh method. Is there any similar
method in ADO .NET ? Because my stored procedures have a
lots parameters and it's very ineffective adding it one by
one.


.
 
Hehe, I was just going to suggest CodeSmith :-)

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
SLODUG - Slovene Developer Users Group
www.rthand.com

Jim Hughes said:
Consider using a tool like CodeSmith to generate your wrapper code from
existing stored procs

Freeware and Pro versions available with sample templates that will do
just what you want.

http://www.EricJSmith.com/CodeSmith/

Hi Miha,

Thanks for your reply. I know that fetching parameters
from the db is very resource consuming (thus it is
inefficient). Usually i won't do that. But in my current
case, development time is very short, so our team must
find the easiest and fastest way to fetch those
parameters, each stored procedure contains an average of
35 parameters.

-----Original Message-----
Hi Hendri,

You might use OleDbConnection.GetOleDbSchemaTable method to look into
parameters or some sort of native SQL DDL statement
However, it is better to programatically set them - inefficient is the way
you are looking for because it has to fetch them from dtb.

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
SLODUG - Slovene Developer Users Group
www.rthand.com

In ADO, there is a way to fetch parameters from stored
procedure into a Command object with
Command.Parameters.Refresh method. Is there any similar
method in ADO .NET ? Because my stored procedures have a
lots parameters and it's very ineffective adding it one by
one.


.
 
Back
Top