And I have a question about select in sqlite bank in WP

1

I started using the SQLite database in Windows Phone.

And I have a question about select in SQLite database.

/*
List items = null;
items = App.db.Query(“select Nome from Usuario”);
ListBox.ItemsSource = items;
*/

This commented select works to display the data in listbox. That is, I can see if you are saving the data in the database. And you're saving!

BUT I'm trying to do something like this:

// ————
string Email;
Email = App.db.Query(“select Email from Usuario”).ToString();

MessageBox.Show(Email);
//————-

I've tried it too (I've been tempted to):

var returnedCollection = App.db.Query(“select Email from Usuario”);
for (int i = 0; i < returnedCollection.Count(); i++)
{
string email = (returnedCollection[i]).ToString();
MessageBox.Show(email);
}

return;

But it also did not work, only BD.Usuario appears in the MessageBox.

    
asked by anonymous 24.06.2014 / 19:11

1 answer

1

The AP resolved like this:

var returnedCollection = App.db.Query(“select Email from Usuario”);
for (int i = 0; i < returnedCollection.Count(); i++)
{
MessageBox.Show(returnedCollection[0].Email.ToString());
}
    
14.10.2014 / 01:51