I am loading my table from mysql and I want to make first column link. I mean link to another form. I want to display student details and when click on a name program will open a new form and display all info about student. Anyone have any idea about how to do?
DataTable table = new DataTable();
MySqlDataAdapter adapsql = new MySqlDataAdapter("SELECT name, surname, dob, sex, nationality, mobile, notes FROM student", connection);
adapsql.Fill(table);
dataGridView1.DataSource = table;
int x = (dataGridView1.RowCount)-1;
label21.Text = Convert.ToString(x);
cmd = connection.CreateCommand();
cmd.CommandText = @"SELECT * FROM reservation";
MySqlDataReader Reader = cmd.ExecuteReader();
if (!Reader.HasRows) return;
while (Reader.Read())
{
reservation.Add(Convert.ToInt16(GetDBString("roomID", Reader)));
}
Reader.Close();