|
-
Nov 8th, 2006, 01:49 PM
#1
Thread Starter
Lively Member
[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
Dim person As New Person
Person.GrowUp(ByVal school as string, ByVal gang as string, Byval family as string)
Person.Work
Dim A as Integer
For A = 1 to 10
Person.Marry()
Person.Divorce()
Next
Person.GiveUp()
Person.Die()
-
Nov 8th, 2006, 04:50 PM
#2
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.
-
Nov 8th, 2006, 05:42 PM
#3
Thread Starter
Lively Member
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.
Dim person As New Person
Person.GrowUp(ByVal school as string, ByVal gang as string, Byval family as string)
Person.Work
Dim A as Integer
For A = 1 to 10
Person.Marry()
Person.Divorce()
Next
Person.GiveUp()
Person.Die()
-
Nov 8th, 2006, 06:15 PM
#4
Re: [2005] passing data parameters
 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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|