Creating simple contacts' application

akshay2000

Inactive Recognized Developer
May 24, 2009
175
16
0
Kanpur
indestructible.in
Hello all!

I am looking into development of something which is similar to people's list in people hub. What I want is a huge list of people on one page with (of course) LonglistSelector. When I tap a member of the list, I want the user to be navigated to the details page of that item. User needs to be able to manipulate and modify the data on the details page. The list is going to be real huge. I have a few question about the approach.

1. What is the best way to store data? I am thinking of creating local database with a few columns with person's name in one column, age in another etc.
If this is the approach to go for, can anyone provide me detailed description about the databases? I have deeply gone through the MSDN, WindowsPhoneGeek and many other documentations. I feel dumb about the whole database scenario.

2. Is XML list as database a good approach for large amounts of data or it will be pain?
 

darthveda

Senior Member
Oct 18, 2009
107
13
0
Bangalore
So basically, I need to go with the local database using LINQ. Now, how do I do that? As I mentioned, I have read intensively. However, I just don't seem to get hang of it.
I created my local database with LINQ based off this sample:
http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh286405(v=vs.92).aspx

First define the columns which you would want to create and then modify the sample code to suit your needs.

For contacts, there is an excellent sample available:
http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh286416(v=vs.92)

if you are stuck with some particular piece of code then let me know, i would be glad to help you out
 

akshay2000

Inactive Recognized Developer
May 24, 2009
175
16
0
Kanpur
indestructible.in
I created my local database with LINQ based off this sample:
http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh286405(v=vs.92).aspx

First define the columns which you would want to create and then modify the sample code to suit your needs.

For contacts, there is an excellent sample available:
http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh286416(v=vs.92)

if you are stuck with some particular piece of code then let me know, i would be glad to help you out
I had gone through those links earlier! Back then, they made very little sense to me. I have researched a bit by now. I will update here if I get stuck somewhere.
 

akshay2000

Inactive Recognized Developer
May 24, 2009
175
16
0
Kanpur
indestructible.in
if you are stuck with some particular piece of code then let me know, i would be glad to help you out
I'm attaching my code file to the post. When I try to run the app and click the button (it tries to add an item to the observablecollection) I get NullReferenceException error. Apparently, the collection's instant hasn't been created. But I tried to instantiate it using 'new' keyword - no luck. Am I doing anything wrong?
 

Attachments

Last edited:

darthveda

Senior Member
Oct 18, 2009
107
13
0
Bangalore
I'm attaching my code file to the post. When I try to run the app and click the button (it tries to add an item to the observablecollection) I get NullReferenceException error. Apparently, the collection's instant hasn't been created. But I tried to instantiate it using 'new' keyword - no luck. Am I doing anything wrong?
solution folder will be better, you are using telerik controls, i can't recreate your solution.
 

akshay2000

Inactive Recognized Developer
May 24, 2009
175
16
0
Kanpur
indestructible.in
It's done!

solution folder will be better, you are using telerik controls, i can't recreate your solution.
Thanks for the response! After a lot of debugging and (almost literally) adding Debug.writeline after each line of code, I managed to solve it. It had nothing to do with the Database or the ObservableCollection. It was totally different - GroupDescriptor issue! More details here: http://stackoverflow.com/questions/...ion-while-adding-item-to-observablecollection

I'll post here if I get stuck with something again.

Again, thanks a lot!
 

darthveda

Senior Member
Oct 18, 2009
107
13
0
Bangalore
Any reason you are using telerik controls? for starters and very simple programs, you can use controls from silverlight toolkit or coding4fun toolkit. i am using longlist selector which does the job just like the jumplist from telerik controls does.
 

akshay2000

Inactive Recognized Developer
May 24, 2009
175
16
0
Kanpur
indestructible.in
Any reason you are using telerik controls? for starters and very simple programs, you can use controls from silverlight toolkit or coding4fun toolkit. i am using longlist selector which does the job just like the jumplist from telerik controls does.
No specific reasons except that the Jumplist provides StickyHeader functionality. And animation framework seems nice addition too!