Chris,
You are passing parameters by reference. In order to do so, you need to
use the ref keyword, like this:
obj.PrintFromRoot(ref sqlDataReader, ref stringBuilder);
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
(E-Mail Removed)
"Chris" <(E-Mail Removed)> wrote in message
news:793DB326-36D6-4619-95FF-(E-Mail Removed)...
> Hi,
>
> I have the following procedure below:
> I am getting 2 errors on compile:
>
> Argument '2': cannot convert from 'System.Data.SqlClient.SqlDataReader' to
> 'ref System.Data.SqlClient.SqlDataReader'
>
> Argument '3': cannot convert from 'System.Text.StringBuilder' to 'ref
> System.Text.StringBuilder'
>
> the PrintChildrenRecursive is a class in a referenced DLL that was written
> in
> VB.NET.
>
> this function takes a dataset and loops through it creating a javastring
> using stringbuilder that creates a parent-child tree of html hyperlinks.
>
> the printchildrecursive function accepts the Dr and Sbuilder ByReference.
>
> private static void PrintFromRoot(SqlDataReader Dr, StringBuilder
> SBuilder)
> {
> PrintChildren PCR = new PrintChildren();
>
> SBuilder.Append("[");
> PCR.PrintChildrenRecursive(1, Dr, SBuilder, false);
>
> SBuilder.Remove(1,2); //remove comma and bracket from beginning of string
>
> SBuilder.Append("];");
> }
>
> I don't understand why conversion is occuring because they are already of
> the correct type as already indicated by the error messages.
>
> thanks
>
> Chris