Hello everyone,
Suppose I have the following code snippets, i.e. goo call foo, DataTable created by goo and foo will only call Rows.Add. Then goo will use the updated data of the DataTable instance from foo.
My question is, in my scenario, any differences or benefits compared of using with and using without ref parameter?
I am using C# + .Net 3.5 + VSTS2008.
void foo (ref DataTable dt)
{
// call Row.Add on dt
}
void goo()
{
DataTable dt1 = ...; // create a new instance of DataTable here
foo (ref dt1);
// read updated content of DataTable by foo here
}
thanks in advance, George