Try
myFunc = sStr.ToString
Secondly, assigning Nothing is not the same as disposing the object. Disposing means you call the Dispose method of the IDisposable interface. Usually this happens when you call the Close method. The clean way to deal with disposable objects would beUsing obj as new whatever() ' do something with obj End Usingwhich is the same as using a try-block where the Finally section calls Dispose. However, StringBuilder is not a class that implements IDisposable. Unlike in VFP you don't have to clear references in .NET. When the object reference is assigned to a local variable, the reference will automatically be collected in the next pass of the garbage collection after the method returned.