title: grid view is not displaying data asp per query written in SqlDataAdapter
body: <p>my front design is like this</p>
  <pre><code>&lt;form id=&quot;form1&quot; runat=&quot;server&quot; style=&quot;width: 1220px&quot;&gt;
  &lt;div&gt;  
  &lt;asp:Button ID=&quot;add_user&quot; runat=&quot;server&quot; Text=&quot;Add User&quot; OnClick=&quot;add_user_Click&quot; /&gt;
  &lt;asp:Button ID=&quot;assign_role&quot; runat=&quot;server&quot; Text=&quot;Change User Role&quot; OnClick=&quot;assgn_role_click&quot;/&gt;&lt;asp:Button ID=&quot;assign_menu&quot; runat=&quot;server&quot; Text=&quot;Assign Menu To User&quot; OnClick=&quot;assgn_menu_click&quot;/&gt;&lt;asp:Button ID=&quot;manage_role&quot; runat=&quot;server&quot; Text=&quot;Manage New Role&quot; OnClick=&quot;manage_new_role&quot; /&gt;         &lt;asp:TextBox ID=&quot;txtSearch&quot; runat=&quot;server&quot; placeholder=&quot;Enter User Name&quot;&gt;&lt;/asp:TextBox&gt;  
  
      
       &lt;asp:Button ID=&quot;btn_search&quot; class=&quot;btn btn-primary&quot; Text=&quot;Search&quot; runat=&quot;server&quot; OnClick=&quot;Search&quot;/&gt;
         &lt;asp:GridView ID=&quot;GridView1&quot; runat=&quot;server&quot; AutoGenerateColumns=&quot;False&quot; CellPadding=&quot;10&quot;
                  OnRowCommand=&quot;GridView1_RowCommand&quot; Width=&quot;990px&quot; AllowPaging=&quot;true&quot; 
                  OnPageIndexChanging=&quot;OnPageIndexChanging&quot; PageSize=&quot;38&quot; 
                  style=&quot;margin-right: 0px&quot;&gt;
                  &lt;Columns&gt;
                      &lt;asp:TemplateField HeaderText=&quot;ACTIONS&quot;&gt;
                          &lt;ItemTemplate&gt;
      &lt;asp:Button ID=&quot;btnEdit&quot; runat=&quot;server&quot; Width=&quot;60&quot; Text=&quot;Edit&quot; CommandName=&quot;EditButton&quot; CommandArgument=&quot;&lt;%# ((GridViewRow) Container).RowIndex %&gt;&quot; OnClientClick=&quot;return confirm('Are you sure you want update?');&quot; /&gt;
      &lt;asp:Button ID=&quot;brnDelete&quot; runat=&quot;server&quot; Width=&quot;60&quot; Text=&quot;Delete&quot; CommandName=&quot;DeleteButton&quot; CommandArgument=&quot;&lt;%# ((GridViewRow) Container).RowIndex %&gt;&quot; OnClientClick=&quot;return confirm('Are you sure you want delete?');&quot; /&gt;
      &lt;/ItemTemplate&gt;
      
          &lt;/asp:TemplateField&gt;   
      
                                                           
                      &lt;asp:BoundField DataField=&quot;user_id&quot; HeaderText=&quot;USER ID&quot;/&gt; 
                      &lt;asp:BoundField DataField=&quot;user_nm&quot; HeaderText=&quot;USER NAME&quot;/&gt;
                      &lt;asp:BoundField DataField=&quot;user_pass&quot; HeaderText=&quot;USER PASSWORD&quot;/&gt;                                  
                      &lt;asp:BoundField DataField=&quot;role_nm&quot; HeaderText=&quot;USER ROLE&quot;/&gt;
                      &lt;asp:BoundField DataField=&quot;user_mode&quot; HeaderText=&quot;USER MODE&quot;/&gt;                                                                
                    &lt;/Columns&gt;          
               &lt;/asp:GridView&gt;         
            &lt;/div&gt;
          &lt;/form&gt;
  </code></pre>
  <p>now to display data on this grid i have written code as below,</p>
  <pre><code>protected void ShowData()
      {
          dt = new DataTable();
          con = new SqlConnection(cs);
          con.Open();
          adapt = new SqlDataAdapter(&quot;SELECT user_id, user_nm, user_pass, role_nm, user_mode FROM users ORDER BY user_nm&quot;, con);
          adapt.Fill(dt);
          if (dt.Rows.Count &gt; 0)
          {
              GridView1.DataSource = dt;
              GridView1.DataBind();
          }
          con.Close();
      }
  </code></pre>
  <p>above return the result fine but it will not perform order by operation on grid please help me.</p>