You declare a new parameters block, but you don't use it!
Try:
public int Insert(Student s)
{
con.Open();
cmd = new SqlCommand("Insert into Students (stdid, studname) values" + "(@stdid, @studname)", con);
cmd.Parameters.AddWithValue("@stdid", s.studentid);
cmd.Parameters.AddWithValue("@studname", s.studentname);
cmd.CommandType = CommandType.Text;
return cmd.ExecuteNonQuery();
}
Note that Parameters.Add (which you are effectively using) is depreciated in favour of AddWithValue, as shown above.