我想知道每个循环。我所拥有的是每个项目的几列,我想循环遍历它并从名称为“英寸”的每一列中取出值。
现在到值不仅是数字而且是字母的部分,例如“1英寸”。
所以我有 3 件物品,分别是“1 英寸”、“5 英寸”和“10 英寸”。
所以我想取出“英寸”(我猜是解析)并将这三个加在一起,所以总和是 16。
如果对于 windows phone 本地数据库 c#
我有一个 ViewModel 和一个模型。模型中的列如下所示
private string _itemSpring;
[Column]
public string ItemSpring
{
get { return _itemSpring; }
set
{
if (_itemSpring != value)
{
NotifyPropertyChanging("ItemSpring");
_itemSpring = value;
NotifyPropertyChanged("ItemSpring");
}
}
}
然后我通过带有连接字符串到数据库的视图模型查看它,
// LINQ to SQL data context for the local database.
public ToDoDataContext toDoDB;
// Class constructor, create the data context object.
public ToDoViewModel(string toDoDBConnectionString)
{
toDoDB = new ToDoDataContext(toDoDBConnectionString);
}