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

Asked

Viewed 110 times

0

I started using the Sqlite database on Windows Phone.

And I have a question about select in Sqlite bank.

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

This commented select works to show the data in listbox. IE, I can see if you are saving the data in BD. And is saving!

But I’ve been wanting to do something like this:

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

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

I tried it too (they passed me to try):

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 didn’t work only appears BD.User in Messagebox.

1 answer

1

AP solved it 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());
}

Browser other questions tagged

You are not signed in. Login or sign up in order to post.