首先让我从一个例子开始,
Public Class EmpDemo
Public Function getEmpData() as DataSet
End Function
End Class
情况1:
Dim ds as New DataSet 'A DataSet instance gets created here
ds = EmpDemo.getEmpData() 'Another DataSet instance gets created here
案例二:
Dim ds as DataSet
ds = EmpDemo.getEmpData() 'A single instance gets created here
问题:
如果我选择案例 1,它将如何影响页面性能?我如何证明案例 2是最佳选择?