You cannot assign a command object to a datagridview source.
Check this for your correction.
private void button2_Click_1(object sender, EventArgs e)
{
if (textBox3.Text == "Hutatma express")
{
SqlCommand cm2 = new SqlCommand("Select * from hutatma", con);
DataTable dth = new DataTable();
SqlDataAdapter da = new SqlDataAdapter(cm2);
da.Fill(dth);
dataGridView1.DataSource = dth;
cmd = new SqlCommand("select * from traintime", con);
cmd1 = new SqlCommand("select * from traintime", con);
trs();
}
else if (textBox3.Text == "Sewagram express")
{
SqlCommand cm1 = new SqlCommand("select * from sewagram", con);
DataTable dts = new DataTable();
SqlDataAdapter da = new SqlDataAdapter(cm2);
da.Fill(dts);
dataGridView1.DataSource = dts;
Image image1 = Image.FromFile(@"D:\asp.net practice\mindicator\mindicator\image\sevagram exp12.jpg");
label3.Image = image1;