Click here to Skip to main content
15,899,005 members
Home / Discussions / Database
   

Database

 
AnswerRe: How can i return the names of a stored procedures input parameters? [modified] Pin
originSH26-Jun-07 0:11
originSH26-Jun-07 0:11 
GeneralRe: How can i return the names of a stored procedures input parameters? Pin
Gamzun26-Jun-07 0:25
Gamzun26-Jun-07 0:25 
GeneralRe: How can i return the names of a stored procedures input parameters? Pin
originSH26-Jun-07 0:28
originSH26-Jun-07 0:28 
GeneralRe: How can i return the names of a stored procedures input parameters? Pin
Gamzun26-Jun-07 0:32
Gamzun26-Jun-07 0:32 
GeneralRe: How can i return the names of a stored procedures input parameters? [modified] Pin
originSH26-Jun-07 1:22
originSH26-Jun-07 1:22 
GeneralRe: How can i return the names of a stored procedures input parameters? Pin
Gamzun26-Jun-07 1:50
Gamzun26-Jun-07 1:50 
AnswerRe: How can i return the names of a stored procedures input parameters? Pin
llamadillo27-Jun-07 15:54
llamadillo27-Jun-07 15:54 
GeneralRe: How can i return the names of a stored procedures input parameters? Pin
Red_Wizard_Shot_The_Food27-Jun-07 22:48
Red_Wizard_Shot_The_Food27-Jun-07 22:48 
Thanks guys I managed to do it in with .NET by using SqlCommandBuilder.DeriveParameters(MySqlCommand)

It was used to create a generic method to loop through values from a DTO and place them into input parameters for a given Stored procedure on the mapper layer of our code. If I cache the results (for speed) it saves us lots of time rewriting very similar stuff inside each mapper to take the dto and asign its values to known paramaters in different procedures.

So what i have is

DataAdapter myMethod(string SProcName, DTOType inputParamsDTO)
{
DataAdapter da = new DataAdapter.
[psudo] open connection to sql
SqlCommandBuilder.DeriveParameters(SProcName)
[psudo] loop
[psudo] if SProcName.Param.Direction == input OR input/Output
[psudo] if inputParamsDTO.Tables[0].Rows[0][i].Contains(SProcName.Param[i].ParamaterName)
[psudo] SProcName.Param[i] = inputParamsDTO.Tables[0].Rows[0]["SProcName.Param[i].ParamaterName"]
[psudo] end loop
[psudo] close connection to sql
[psudo] return da
}

So we pass it a SProc and a DTO (or dataset) and it gives us back a data adapter we can just calla Fill() on.
But it needs to cache some where to stop excessive round trips
GeneralRe: How can i return the names of a stored procedures input parameters? Pin
adambl5-Jul-07 9:45
professionaladambl5-Jul-07 9:45 
QuestionInstall SQL Server 2005 with 2000 already installed Pin
Kiefie25-Jun-07 23:25
Kiefie25-Jun-07 23:25 
AnswerRe: Install SQL Server 2005 with 2000 already installed Pin
originSH25-Jun-07 23:30
originSH25-Jun-07 23:30 
GeneralRe: Install SQL Server 2005 with 2000 already installed Pin
Kiefie26-Jun-07 1:40
Kiefie26-Jun-07 1:40 
GeneralRe: Install SQL Server 2005 with 2000 already installed Pin
originSH26-Jun-07 2:02
originSH26-Jun-07 2:02 
GeneralRe: Install SQL Server 2005 with 2000 already installed Pin
Kiefie26-Jun-07 2:11
Kiefie26-Jun-07 2:11 
GeneralRe: Install SQL Server 2005 with 2000 already installed Pin
originSH26-Jun-07 2:19
originSH26-Jun-07 2:19 
GeneralRe: Install SQL Server 2005 with 2000 already installed Pin
Kiefie26-Jun-07 23:01
Kiefie26-Jun-07 23:01 
Generalescaping Pin
V.25-Jun-07 22:06
professionalV.25-Jun-07 22:06 
GeneralRe: escaping Pin
Giorgi Dalakishvili25-Jun-07 22:12
mentorGiorgi Dalakishvili25-Jun-07 22:12 
GeneralRe: escaping Pin
V.25-Jun-07 22:15
professionalV.25-Jun-07 22:15 
GeneralRe: escaping Pin
Giorgi Dalakishvili25-Jun-07 22:21
mentorGiorgi Dalakishvili25-Jun-07 22:21 
GeneralRe: escaping Pin
Colin Angus Mackay26-Jun-07 0:07
Colin Angus Mackay26-Jun-07 0:07 
GeneralRe: escaping Pin
V.26-Jun-07 0:25
professionalV.26-Jun-07 0:25 
GeneralRe: escaping Pin
Dave Kreskowiak26-Jun-07 5:30
mveDave Kreskowiak26-Jun-07 5:30 
GeneralRe: escaping Pin
V.26-Jun-07 6:16
professionalV.26-Jun-07 6:16 
GeneralRe: escaping [modified] Pin
Dave Kreskowiak26-Jun-07 6:20
mveDave Kreskowiak26-Jun-07 6:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.