TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Sweta Sinha
NA
51
42.2k
Add items to the listbox in Windows Phone application
Mar 3 2015 5:37 AM
Hi,
I have a listbox in xaml.I have to fetch a list of string from database and then have to display them in the listbox.The count of the items can be maximum 30,000.
I am fetching the data but when I am adding it in the listbox it crashes giving "Out of Memory Exception".
My Code:-
List<string> lstOfVals = Globals.dbHandler.getFullCache(s);
Dispatcher.BeginInvoke(() =>
{
listbox.Items.Clear();
foreach (string str in lstOfVals)
{
TextPhoneControl tpc = new TextPhoneControl ();
tpc.shorthandValue.Text = str;
listbox.Items.Add(tpc);
}
});
Reply
Answers (
6
)
Search a string within a string
how to create empty element <test/> thru XmlTextWriter in C#