Windows Form Database Update

  • Thread starter Thread starter thebestakash
  • Start date Start date
T

thebestakash

Guest
about-- Windows Form, Database,Dataset
Using-- Local Database Mdf file
Software--Visual Studio 2012

Problem
Unable to add new row to database and dataset.

Description.
after adding row, It remains only till application is open, database gets reset after application close. All changes made to dataset and database are lost.

Code.

accountBookDataSet.BillRow billRow = accountBookDataSet.Bill.NewBillRow();
billRow.BookNo = Convert.ToInt32(bookNoLabel1.Text);
billRow.ID = Convert.ToInt32(invoiceNoLabel1.Text);
billRow.InvoiceNo = Convert.ToInt32(invoiceNoLabel1.Text);
billRow.To = Customer.Text;
billRow.Date = Convert.ToDateTime(dateTimePicker1.Text);

accountBookDataSet.Bill.Rows.Add(billRow);

accountBookDataSet.AcceptChanges();

Please help ASAP

Continue reading...
 
Back
Top