Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 any VB example for using reflection to build sqlpa

Author  Topic 

rtutus
Aged Yak Warrior

522 Posts

Posted - 2006-06-28 : 19:48:21
any VB example for using reflection to build sqlparameters automatically in the code from a SProc

Thanks a lot

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2006-06-28 : 20:15:00
Can you be more specific as to what you are looking for?
Go to Top of Page

AndrewMurphy
Master Smack Fu Yak Hacker

2916 Posts

Posted - 2006-06-29 : 11:26:10
Are you asking if a vb code could ask a SP what it's parameters are...before filling them in?
If so...yes. I've seen an example of same (somewhere) before here.
Go to Top of Page

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2006-06-29 : 11:43:39
The sqlcommmandbuilder class has a static method that will add the parameters from a stored procedure to a command.

example:

sqlCommand cm = new sqlCommand( .....);
SqlCommandBuilder.DeriveParameters(cm);

Now the Parameters() property of the command contains the parameters.
Go to Top of Page

rtutus
Aged Yak Warrior

522 Posts

Posted - 2006-06-30 : 17:10:24
Cool.
I also found this article. Not sure what it does exactly:
Auto-Generating Wrapper Classes for Stored Procedures, Part 2: The Internals of the AutoSproc Tool:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/autointe2.asp
Go to Top of Page
   

- Advertisement -