我是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"];
}
XAML代碼:
<ListBox Margin="0,365,0,0" x:Name="mylist1">
<ListBoxItem Height="190">
<TextBlock Width="443" Height="55" x:Name="txt1"></TextBlock>
</ListBoxItem>
</ListBox>
我顯示在消息框中的值。但我想在列表視圖中顯示值