i am working on a library system. i have to calculate fine on receive book form... due date is after 14 days of issue date, which i calculated on issue book form..
if the the book is return after due date there will be fine of 10 rs per day .. i am unable to calculate it..
there is a form for issuing books. i have calculate due date and issue date here.
private void Form17_Load(object sender, EventArgs e) { textBox1.ReadOnly = true; DateTime d = DateTime.Now; textBox1.Text = d.Day + "/" + d.Month + "/" + d.Year; textBox2.ReadOnly = true; DateTime today = DateTime.Now; DateTime dueDate = today.AddDays(14); textBox2.Text = dueDate.Day + "/" + dueDate.Month + "/" + dueDate.Year;
now there is another form for receiving book. there fine will be calculated on above criteria after clicking submit button. i want to get dueDate from Prev form...
or if i get the dueDate from database via oleDb DataAdapter, how to get the value that is stored in data set and assign it to a variable.
OleDbDataAdapter da = new OleDbDataAdapter(" select dueDate from issue where title = '" + comboBox1.SelectedItem + "' ", con); DataSet ds = new DataSet(); da.Fill(ds, "issue");