public void Form1_Load(object sender, EventArgs e)
{
con = new SqlConnection("server=ABHINAVPC;database=timtable;trusted_connection=true");
con.Open();
ds = new DataSet();
}
private void dataGridView2_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
DataGridViewCell cell =(DataGridViewCell)dataGridView2.Rows[e.RowIndex].Cells[e.ColumnIndex];
if (cell.ValueType.ToString() == "Abhinav")
{
MessageBox.Show("Right Name");
}
else
{
MessageBox.Show("Wrong Name");
}
}
}