Your code seems to be correct. Cannot tell you why without debugging it line by line
Here.. Try this. It works for me
SqlConnection connection = new SqlConnection();
connection.ConnectionString = "Password=sasasasas;Persist Security Info=True;User ID=sa;Initial Catalog=sasasas;Data Source=sasasas;";
SqlDataAdapter adp = new SqlDataAdapter();
SqlCommand command=new SqlCommand();
command.CommandText="SELECT * FROM Students";
command.CommandType = CommandType.Text;
command.Connection = connection;
adp.SelectCommand = command;
connection.Open();
DataTable dt=new DataTable();
adp.Fill(dt);
connection.Close();
GridView1.DataSource = dt;
GridView1.DataBind();