My gridview are not display on webform

Sep 4 2011 6:58 AM
hello everyone ;

the question is, my gridview are not display in the webform. this is my code. there is no error in my code, but gridview are not display.

protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                load_grid_doctor();
            }
        }


        protected void Button_show_Click(object sender, EventArgs e)
        {
            load_grid_doctor();
        }


        public void load_grid_doctor()
        {
            SqlCommand cmd = new SqlCommand("select * from [doctor]",connection.get());
           
            SqlDataAdapter da = new SqlDataAdapter(cmd);
            DataSet ds = new DataSet();
            da.SelectCommand=cmd;
            da.Fill(ds);
            GridView_doctor.DataSource = ds;
            GridView_doctor.DataBind();
        }
    }

regards
sumaira

Answers (13)