Difference between declaration of instance operation outside & inside

Posted by Oswaldlily under ASP.NET on 5/7/2014 | Points: 10 | Views : 297 | Status : [Member] | Replies : 1
Whats the difference between a and b

what will happen if i call new instance outside and inside
a)
datacontext dc=new datacontext()
public function collect_names()
dc.LLO_collection_SP()
return dc
end sub


b)
datacontext dc
public function collect_names()
dc=new datacontext()
dc.LLO_collection_SP()
return dc
end sub




Responses

Posted by: Chandradev819 on: 5/7/2014 [Member] Starter | Points: 25

Up
0
Down
Hi

There is only difference i.e scope of datacontext. In first case you use dc instance as global. But in second case you can use dc instance as Local i.e with in given function.

Thanks and Regards
Chandradev
My Blog

Oswaldlily, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response