title: How to get the data when I select a datagridview cell or column
body: <p>I have 2 datagridview controls in a Windows Forms application.<br>
  I would like to get the info of a person when I select first datagridview cell or row to next datagridview:</p>
  
  <pre><code>try
  {
  
      ConnectionStringSettings consettings =                                                        ConfigurationManager.ConnectionStrings["attendancemanagement"];                                                                     
      string connectionString = consettings.ConnectionString;
      SqlConnection con = new SqlConnection(connectionString);
      con.Open();
      adap3 = new SqlDataAdapter(@"SELECT   Date,Attendance,Remarks FROM dailyattendance where employee_id='"+DailyGV.CurrentRow+"'", con);
  
      ds3 = new DataSet();
      adap3.Fill(ds3, "dailyattendance");
      dataGridView1.DataSource = ds3.Tables[0];
  
  }
  </code></pre>
  
  <p>Im trying the above code. But it's not working.</p>