Search   

Friday, February 10, 2012

Support » Support Forum

Register  Login

 Menu  
 
    

 Welcome!  
 


Welcome to the NDO support forum!

kreis.gif Please register/login at the site if you want to post a thread. We sometimes copy support mails of common interest to the forum. They appear with anonymous sender.
kreis.gif Please post your messages in English language if possible. You can do your posts also in German, we will translate your post and our answer so that all users of the forum can read your posts.
kreis.gif The forum software requires that javascript is enabled.
kreis.gif Please do not insert licence information or licence keys in forum posts.
kreis.gif If you know a good answer to a post of another user, feel free to reply!
kreis.gif The forum is monitored. We reserve the right to remove posts we consider not to be useful for other forum users.

   Print   

      
 NDO Support Forum  
 
SearchForum Home
  NDO-Forum postings in english please, if possible.  Developing with NDO  NullReferenceEx...
 Re: NullReferenceException in Query
 
 5/3/2007 2:10:07 PM
Mirko
109 posts
5th


Re: NullReferenceException in Query

Hi Tobias,

I'm glad to hear this. BTW, it's a good idea to initialize the list members in the declaration -- the initialization will be inserted in every constructor:

public class MyClass
{
    List<MyElement> myList = new List<MyElement>;

    MyClass(){} // will contain the initialization

    MyClass(string par) {...} // will contain the initialization too
}

If you don't like this style, you can choose the following:

public class MyClass
{
    List<MyElement> myList;

    MyClass()
    {
        myList = new List<MyElement>;
    }

    MyClass(string par)  :  this()  // calls the default constructor
    {...} 
}

Regards,
Mirko

  NDO-Forum postings in english please, if possible.  Developing with NDO  NullReferenceEx...
  SearchSearch  Forum HomeForum Home