No that was a typo.

I cannot New a SPPC  params = New StoredProcedureParameterCollection()
Error indicates that it is Friend.  I am just on that line attempting
to create it so I don't understand where it gets Friend from?

current version below that still doesn't work.

    Private Function getSP(ByVal DB As Database, ByVal thisSP As
String, ByVal spF As StoredProcedure, ByRef FailFlag As Boolean, ByRef
params As StoredProcedureParameterCollection) As String
        'StoredProcedureParameter param;
        'param = new StoredProcedureParameter(sp, "@ID", DataType.Int);
        'sp.Parameters.Add(param);
        'params = New StoredProcedureParameterCollection()
        If Not spF Is Nothing Then
            Dim scF As StringCollection = spF.Script()
            FailFlag = False
            spF.TextMode = False   '   ADD THIS LINE
            Dim cnt As Integer = 0
            For Each p As StoredProcedureParameter In spF.Parameters
                Dim param As StoredProcedureParameter = New
StoredProcedureParameter(spF, p.Name, p.DataType)
                params.Add(param, cnt)
                cnt = cnt + 1
            Next
            Return spF.TextBody.ToString()
        Else
            Return ""
        End If

    End Function


On Thu, Jun 2, 2011 at 6:19 AM, Reuben Bartolo <[email protected]> wrote:
> Are you sure you meant the inner Add() function?
> params.Add(Add(param, cnt))
>
> Because I guess that function returns a null.
> On 1 June 2011 17:31, Stephen Russell <[email protected]> wrote:
>>
>> VS2010 I am reading any existing params and I want to load them into a
>> ByRef params As StoredProcedureParameterCollection for use later.
>>
>> As the code runs I get a null exception error and I cannot understand
>> why? p has values for use to param and param has values for params.
>>
>> spF is a loaded StoredProcedure off of the "From" server.  I have to
>> copy it's parts over to a SP off of the "To" server.  This goes after
>> Params, and we have A LOT OF THEM!
>>
>> For Each p As StoredProcedureParameter In spF.Parameters
>>    Dim param As StoredProcedureParameter = New
>> StoredProcedureParameter(spF, p.Name, p.DataType)
>>
>>    params.Add(Add(param, cnt))  '  << Get a null exception here??
>>    cnt = cnt + 1
>> Next
>>
>> Anyone else done this? Please don't say buy red-gate. That door
>> slammed on my fingers day 1 here. :(
>>
>>
>>
>> --
>> Stephen Russell
>>
>> Unified Health Services
>> 60 Germantown Court
>> Suite 220
>> Cordova, TN 38018
>>
>> Telephone: 888.510.2667
>>
>> 901.246-0159 cell
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML
>> Web Services,.NET Remoting" group.
>> To post to this group, send email to [email protected]
>> To unsubscribe from this group, send email to
>> [email protected]
>> For more options, visit this group at
>> http://groups.google.com/group/dotnetdevelopment?hl=en?hl=en
>> or visit the group website at http://megasolutions.net
>
> --
> You received this message because you are subscribed to the Google
> Groups "DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML
> Web Services,.NET Remoting" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/dotnetdevelopment?hl=en?hl=en
> or visit the group website at http://megasolutions.net
>



-- 
Stephen Russell

Unified Health Services
60 Germantown Court
Suite 220
Cordova, TN 38018

Telephone: 888.510.2667

901.246-0159 cell

-- 
You received this message because you are subscribed to the Google
Groups "DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML
Web Services,.NET Remoting" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/dotnetdevelopment?hl=en?hl=en
or visit the group website at http://megasolutions.net

Reply via email to