Search   

Sunday, February 05, 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  Error while try...
 Error while trying to Get List.
 
 8/14/2006 3:51:41 PM
mz
1 posts


Error while trying to Get List.
 Modified By mz  on 8/14/2006 3:55:01 PM)
Hi everybody,
great software, but while trying I got this error: I did the example.
Writing to database was easy and great. But for getting data back from database I always get an error: The code I used is:
The persistence Class I used is Client.cs my code for writing was:
PersistenceManager pm = new PersistenceManager();
Client cl = new Client(); cl.FirstName = "Martin";
cl.LastName = "Zeug"; cl.EMail = "martin.zeug@meez.de";
cl.Admin = 1; cl.Password = "test";
pm.BuildDatabase();
pm.MakePersistent(cl);
pm.Save();

My code for Reading is:
PersistenceManager pm = new PersistenceManager();
NDOQuery query = new NDOQuery(pm);
List lstClient = query.Execute();
foreach (Client e in lstClient)
Console.WriteLine(lstClient[0].LastName + ", " + lstClient[0].FirstName);


The error I always get is: "Der Objektverweis wurde nicht auf ein Objektinstanz festgelegt".
the error occours at : List lstClient = query.Execute();
I did everything like in the video tutorial. Thanks Martin
 8/14/2006 7:06:42 PM
Support
5 posts


Re: Error while trying to Get List.
 Modified By admin  on 8/16/2006 1:54:29 PM)

Hello Martin, as the parameter for your NDOquery you have to enter the generic parameter type of your persistent class (for .NET 2.0) , in your example 'Client'.

So your query should look like this:

NDOQuery<Client> query = new NDOQuery<Client>(pm);
List<Client> lstClient = query.Execute();


So you get a typed list of your Client objects.
Look also at the examples under "How NDO works - Queries" in this website.

Regards NDO Support

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