WPF リストボックスに次のアイテム A (文字列) とアイテム B (10 進数) があります。
それぞれのデータ型で MS SQL データベースのテーブルに保存する つもりです。
DataClasses1DataContext dc = new DataClasses1DataContext();
foreach (var items in MyListBox.Items)
{
//I was thinking in this terms but I doubt if its the correct code
items=MyListBox.Items.Cast<String>().ToList();
//
//Then use this Linq Statement to insert the data
Student std = new Student();
std.Name=items
std.Marks=items
dc.Student.InsertOnSubmit(std);
dc.SubmitChanges();
}
説明が必要な場合はお尋ねください。私はまだ C#、wpf、Linq に慣れています