Tech
Forums
Jobs
Books
Events
Live
Interviews
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
4
Reply
Constructor question, reference problem
Miodrag
Sep 18 2008 5:52 AM
2.1k
Reply
Hello I have two questions. 1. Is it possible to call base constructor in the body of the current constructor? I want code like this: class MyClass { public MyClass() { // some code here base(); } } 2. I don't understand this code. I have an object that returns reference to the DataTable it contains. I am wondering how come that in following code t variable remains valid: void MyClass() { DataTable t; void SomeFunc(){ using ( ObjectWithTable owt = new ObjectWithTable() ) { t = owt.Table; } } } The GC will free the owt as soon as it exits the using statement, but I can still access its table over t. Thanks.
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
4
)
Next Recommended Forum
Image Path is not showing image in CS in asp.net c#
Exporting Selected Range Of pages from crystal reports