Click here to Skip to main content
15,896,606 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello sir/madam
I am developing a window application with ACCESS database
there are 22 field in my table.In order to update records I am trying to fetch these records at a form.
So flow is like this .
from "MS ACCESS" to "DataGridView" to form Controls(eg. textbox, combox ,datetime picker).
there are three columns of date in my table. i.e.
sanction_date, dob,renewal_date.there are approx 17000 records .
Date format in ms access is like this.
sanction_date(08-Jul-09) , renewal_date(02/21/2013), dob (blank,to be updated).
when these values are retrieved in datagrid view its format in datagrid view is like this.
sanction_date(04/29/2013),renewal_date(04/28/2016).
the date timepicker control does not fetch the value from datagrid view.
my code is...
private void buttonEdit_Click(object sender, EventArgs e)
{

Form2 t = new Form2();
t.Show();
int i;
i = dataGridView1.SelectedCells[0].RowIndex;
t.comboBoxthana.SelectedItem = dataGridView1.Rows[i].Cells[0].Value.ToString();
t.textBoxLicence_number.Text = dataGridView1.Rows[i].Cells[1].Value.ToString();
t.dateTimePicker1.Value =DateTime.Parse(dataGridView1.Rows[i].Cells[2].Value.ToString());
}
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900