when i run rertrive data the error shown

  private void dataGridView1_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            txt_reser.Text = dataGridView1.SelectedRows[0].Cells[0].Value.ToString();
            text_guest.Text = dataGridView1.SelectedRows[0].Cells[1].Value.ToString();
            txt_room.Text = dataGridView1.SelectedRows[0].Cells[2].Value.ToString();
            txt_servce.Text = dataGridView1.SelectedRows[0].Cells[3].Value.ToString();
            txt_days.Text = dataGridView1.SelectedRows[0].Cells[4].Value.ToString();
            check_in.Text = dataGridView1.SelectedRows[0].Cells[5].Value.ToString();
            check_out.Text = dataGridView1.SelectedRows[0].Cells[6].Value.ToString();
            MessageBox.Show("Data Retrived", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);


        }

String was not recognized as a valid DateTime.

Recommended Answers

All 3 Replies

Where in your code you are using aDateTime? Please rephrase your question.

line 8 and line 9

What are the values stored in Cells[5] and Cells[6] of your dataGridView?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.