satish babu

satish babu

  • 1k
  • 633
  • 82.9k

abt using keyword

Jul 19 2013 7:03 AM
Hi,
  In sharepoint we are using like this
  using(spsite objsite =new  spsite(http://localhost:4141/marketing)
  {
  using(spweb objweb=objsite.openweb())
  {
  ..................
 }

 }
In the above way we are writing code.Here we used the keyword "using" for spweb and spsite means here we are specifing scope.If i am not used for spweb using keyword means already using keyword is available for spsite, is it kill the whole obejcts in that scope after completing executing.Why we need to write again using keyword for spweb also?Can anyone help me to explore this question. 

Answers (2)