Hi!
I have set up a small test database to get familiar with SQL CE. My code looks like this:
Test db;
public Window1()
{
InitializeComponent();
db = new Test("Data Source=test.sdf;");
if (!db.DatabaseExists())
db.CreateDatabase();
this.List.ItemsSource = db.List;
}
private void Add_Click(object sender, RoutedEventArgs e)
{
var item = new List();
item.Value = this.New.Text;
db.List.InsertOnSubmit(item);
db.SubmitChanges();
this.New.Clear();
}
Works fine, except the listbox is not updated! How can I tell the listbox: "Hey, I've inserted an item, look for it NOW!"?
Thanks