我是 Windows Phone 8 开发的新手。我在 sqlite 数据库中有一组值。现在想在列表视图中显示所有值。C#代码
Database database = new Database(ApplicationData.Current.LocalFolder, "people.db");
await database.OpenAsync();
string query = "SELECT * FROM PEOPLE";
Statement statement = await database.PrepareStatementAsync(query);
statement.EnableColumnsProperty();
while (await statement.StepAsync())
{
MessageBox.Show(statement.Columns["Name"] );
txt1.Text = statement.Columns["Name"];
}
xml代码:
<ListBox Margin="0,365,0,0" x:Name="mylist1">
<ListBoxItem Height="190">
<TextBlock Width="443" Height="55" x:Name="txt1"></TextBlock>
</ListBoxItem>
</ListBox>
我在消息框中显示值。但我想在列表视图中显示值