Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > ADO.NET
|
ADO.NET For discussion about ADO.NET.  Topics such as question regarding the System.Data namespace are appropriate.  Questions specific to a particular application should be posted in a forum specific to the application .
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ADO.NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 24th, 2003, 07:37 AM
Registered User
 
Join Date: Jul 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Work around for DeriveParameters member

Hi,

I am trying to use the following code in my test application, but I get a build error saying "deriveParameters" is not a member of SqlCommandBuilder

Private Shared Function DiscoverSpParameterSet(ByVal connectionString As String, _
ByVal spName As String, _
ByVal includeReturnValueParameter As Boolean, _
ByVal ParamArray parameterValues() As Object) As SqlParameter()

Dim cn As New SqlConnection(connectionString)
Dim cmd As SqlCommand = New SqlCommand(spName, cn)
Dim discoveredParameters() As SqlParameter

Try
cn.Open()
cmd.CommandType = CommandType.StoredProcedure
SqlCommandBuilder.DeriveParameters(cmd)
If Not includeReturnValueParameter Then
cmd.Parameters.RemoveAt(0)
End If

discoveredParameters = New SqlParameter(cmd.Parameters.Count - 1) {}
cmd.Parameters.CopyTo(discoveredParameters, 0)
Finally
cmd.Dispose()
cn.Dispose()

End Try

Return discoveredParameters

End Function 'DiscoverSpParameterSet

I am using Beta2, so how can I write the code, which achieves the same, as I am very interested in getting the same functioanlity.

Any code example would be helpful.
Thanks





Similar Threads
Thread Thread Starter Forum Replies Last Post
Hi.. new member here.. renai C# 1 August 26th, 2007 11:20 AM
Problem in OLEDBCommandBuilder.DeriveParameters Prasad_Tina ADO.NET 3 January 13th, 2007 07:08 AM
Hello from a new member aehb C# 0 March 10th, 2005 05:51 PM
I'm a new member.. kiddyboy Visual C++ 1 August 12th, 2003 07:21 AM
Member kilika Forum and Wrox.com Feedback 6 July 18th, 2003 12:37 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.