简体   繁体   中英

Can write DAL parameter collection from stored procedure?

Is there some way that I can get parameter collection code in C# to be used in DAL by running a stored procedure ? please help.

Take a look at SqlCommandBuilder.DeriveParameters() . ( It also works in the latest Oracle drivers )

It will load the parameters from the stored procedure into the .Parameters property of your DbCommand object and you can foreach() to loop through them to get the names, types, and directions...

Hope that's what you were looking for...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM