private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { SqlConnection con = new SqlConnection("Data Source=SW-PC-20;Initial Catalog=PSM;Integrated Security=True"); con.Open(); SqlCommand com = new SqlCommand("select * from Publicity_Threshold where Threshold_id=@Threshold_id='" + dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString() + "'", con); SqlDataReader dr = com.ExecuteReader(); if (dr.HasRows) { dr.Read(); txtThresholdID.Text = dr[0].ToString(); cboThreholdname.Text = dr[1].ToString(); cbomethodid.Text = dr[2].ToString(); cbomediaused.Text = dr[3].ToString(); startingdate.Value = dr[4].ToString(); } dr.Close(); con.Close(); }
startindate.Value = dr[4];
startingdate.Value = Convert.ToDateTime(dr[4].ToString());
startingdate.Text = dr[4].ToString();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)