[2005] passing data parameters
I'm plugging a data adapter into a stored procedure in a database. then, i'm filling a dataset with this data, but its telling me i need to pass parameters. How can I detect the required parameters for the procedure, so that i can request them from the user? can this be done through the dataset?
thank you
Re: [2005] passing data parameters
Assuming that you're using SQL Server, you can use the SqlConnection.GetSchema method to get that information. Other data providers expose similar functionality.
Working with the GetSchema Methods
Having said that, it seems odd to me that you know at design time which sproc to call but you don't know what parameters it requires.
Re: [2005] passing data parameters
the sproc is defined at runtime, with the user choosing one out of a list. thank you for the resource.
Re: [2005] passing data parameters
Quote:
Originally Posted by colonel720
the sproc is defined at runtime, with the user choosing one out of a list. thank you for the resource.
Seems reasonable. You can use the same functionality to get the list of sprocs too. Calling GetSchema will return a DataTable. You can then bind that DataTable directly to your ComboBox or whatever, setting the DisplayMember to the appropriate column.