- Joined
- Aug 30, 2007
- Messages
- 269
- Reaction score
- 0
- Points
- 16
I am trying to get the information from a object in my combobox but its not working. Here is my code. I am using entity framework 6.0 and trying to make a flash card program.
private void button1_Click(object sender, EventArgs e)
{
using (fCardsEntities context = new fCardsEntities())
{
Book book = (Book)cmbBooks.SelectedItem;
context.Cards.Add(new Card { Chapter = textBox1.Text, BookId = book.Id });
context.SaveChanges();
}
private void button1_Click(object sender, EventArgs e)
{
using (fCardsEntities context = new fCardsEntities())
{
Book book = (Book)cmbBooks.SelectedItem;
context.Cards.Add(new Card { Chapter = textBox1.Text, BookId = book.Id });
context.SaveChanges();
}