我为我的应用程序创建了一个数据库,它使用了一个 sdf 数据库。当我查询数据库并将其放入 ObservableCollection 时,我得到了信息,但如何访问其中的元素?有什么帮助吗?
var mathItemsInDB = from Math_Info math in mathDB.Math_Information
where math.mathID == 0 select math;
Math_Info_Items = new ObservableCollection<Math_Info>(mathItemsInDB);
base.OnNavigatedTo(e);
}
private void displayProblem()
{
//here i would like to display the mathproblem fetched from the db and not an already created array
this.MathProblem.Text = mathProblems[problemNumber]; //displays the mathproblem/equation
}