title: Grid view in asp is not showing in the webapp
body: <p><strong>This is the Employee.aspx file</strong></p>
  <pre><code>&lt;%@ Page Language=&quot;C#&quot; AutoEventWireup=&quot;true&quot; CodeBehind=&quot;Employee.aspx.cs&quot; Inherits=&quot;Azure_Migrated_App.Employee&quot; %&gt;
      
      &lt;!DOCTYPE html&gt;
      
      &lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
      &lt;head runat=&quot;server&quot;&gt;
          &lt;title&gt;&lt;/title&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;form id=&quot;form1&quot; runat=&quot;server&quot;&gt;
              &lt;div&gt;
                  &lt;h1&gt;Employee in Our Database:&lt;/h1&gt;
                  &lt;asp:GridView ID=&quot;Gridview1&quot; AutoGenerateColumns=&quot;true&quot; runat=&quot;server&quot;&gt;
                  &lt;/asp:GridView&gt;
              &lt;/div&gt;
          &lt;/form&gt;
      &lt;/body&gt;
      &lt;/html&gt;
  </code></pre>
  <p><strong>This is the Employee.aspx.cs file</strong></p>
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Configuration;
  using System.Data;
  using System.Data.SqlClient;
  using System.Linq;
  using System.Web;
  using System.Web.UI;
  using System.Web.UI.WebControls;
  
  namespace Azure_Migrated_App
  {
      public partial class Employee : System.Web.UI.Page
      {
          protected GridView GetGridview1()
          {
              return Gridview1;
          }
  
          protected void Page_Load(object sender, EventArgs e, GridView gridview1)
          {
              //First Establish the connection string to your database.This we can read from the web.config file.
              //so first create an entry to store the database connection string in your web.config file
              string dbConnectionString = ConfigurationManager.ConnectionStrings[&quot;DataBaseConnectionStrings&quot;].ConnectionString;
  
              string queryString = &quot;SELECT * FROM Employee&quot;;//this return all records from database.
              using (SqlConnection sqlConnection1 = new SqlConnection(dbConnectionString))
              {
                  sqlConnection1.Open();
                  SqlDataAdapter dataAdpter = new SqlDataAdapter(queryString, sqlConnection1);
                  DataTable dtbl = new DataTable();
                  dataAdpter.Fill(dtbl);
                  Gridview1.DataSource = dtbl;
                  Gridview1.DataBind();
              }
              NewMethod();
  
          }
  
          private void NewMethod()
          {
              Gridview1.DataBind();
          }
      }
  }
  </code></pre>
  <p><strong>This is the web.config file</strong></p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;!--
    For more information on how to configure your ASP.NET application, please visit
    https://go.microsoft.com/fwlink/?LinkId=169433
    --&gt;
  &lt;configuration&gt;
      &lt;connectionStrings&gt;
          &lt;add name=&quot;DataBaseConnectionStrings&quot; connectionString=&quot;Data Source=WIN2019\WEBAPP;Initial Catalog=employee;Persist Security Info=True;User ID=sa;Password=***********;Max Pool Size=5000;Connect Timeout=60&quot; providerName=&quot;System.Data.SQLClient&quot;/&gt;
      &lt;/connectionStrings&gt;
    &lt;system.web&gt;
      &lt;compilation debug=&quot;true&quot; targetFramework=&quot;4.6.2&quot; /&gt;
      &lt;httpRuntime targetFramework=&quot;4.6.2&quot; /&gt;
      &lt;pages&gt;
        &lt;namespaces&gt;
          &lt;add namespace=&quot;System.Web.Optimization&quot; /&gt;
        &lt;/namespaces&gt;
        &lt;controls&gt;
          &lt;add assembly=&quot;Microsoft.AspNet.Web.Optimization.WebForms&quot; namespace=&quot;Microsoft.AspNet.Web.Optimization.WebForms&quot; tagPrefix=&quot;webopt&quot; /&gt;
        &lt;/controls&gt;
      &lt;/pages&gt;
    &lt;/system.web&gt;
    &lt;runtime&gt;
      &lt;assemblyBinding xmlns=&quot;urn:schemas-microsoft-com:asm.v1&quot;&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name=&quot;Antlr3.Runtime&quot; publicKeyToken=&quot;eb42632606e9261f&quot; /&gt;
          &lt;bindingRedirect oldVersion=&quot;0.0.0.0-3.5.0.2&quot; newVersion=&quot;3.5.0.2&quot; /&gt;
        &lt;/dependentAssembly&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name=&quot;Newtonsoft.Json&quot; publicKeyToken=&quot;30ad4fe6b2a6aeed&quot; /&gt;
          &lt;bindingRedirect oldVersion=&quot;0.0.0.0-12.0.0.0&quot; newVersion=&quot;12.0.0.0&quot; /&gt;
        &lt;/dependentAssembly&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name=&quot;WebGrease&quot; publicKeyToken=&quot;31bf3856ad364e35&quot; /&gt;
          &lt;bindingRedirect oldVersion=&quot;0.0.0.0-1.6.5135.21930&quot; newVersion=&quot;1.6.5135.21930&quot; /&gt;
        &lt;/dependentAssembly&gt;
      &lt;/assemblyBinding&gt;
    &lt;/runtime&gt;
    &lt;system.codedom&gt;
      &lt;compilers&gt;
        &lt;compiler language=&quot;c#;cs;csharp&quot; extension=&quot;.cs&quot; type=&quot;Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35&quot; warningLevel=&quot;4&quot; compilerOptions=&quot;/langversion:default /nowarn:1659;1699;1701&quot; /&gt;
        &lt;compiler language=&quot;vb;vbs;visualbasic;vbscript&quot; extension=&quot;.vb&quot; type=&quot;Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35&quot; warningLevel=&quot;4&quot; compilerOptions=&quot;/langversion:default /nowarn:41008 /define:_MYTYPE=\&amp;quot;Web\&amp;quot; /optionInfer+&quot; /&gt;
      &lt;/compilers&gt;
    &lt;/system.codedom&gt;
  &lt;/configuration&gt;
  </code></pre>
  <p>I uploaded below the database photo , the problem is that the grid view is not displaying at all</p>
  <p><strong>This is the database</strong>
  <a href="https://i.stack.imgur.com/1tUlI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1tUlI.png" alt="Database" /></a></p>
  <p>I uploaded below the database photo , the problem is that the grid view is not displaying at all</p>