title: How to make GridView Visible in VB.Net
body: <p>I have a <code>GridView</code> on a form and it's not visible the browser even though <code>Visible</code> has been set to <code>True</code> in the Property Window. More so, I have the following code to enable data to be visible in the columns of the <code>GridView</code>, but nothing seems to work for me. I'd be glad if someone could help me out.</p>
  
  <pre><code>Sub showgrid()
       Try
           ds.Clear()
           ada = New SqlDataAdapter("Select SubjectCode'Subject Code',SubjectName'Subject Name',SubjectType'Subject Type',UserId'User Id',Password from ProgramDetails.Subjects", cn)
           ada.Fill(ds, "ProgramDetails.Subjects")
           cmd = New SqlCommand("Select SubjectCode'Subject Code',SubjectName'Subject Name',SubjectType'Subject Type',UserId'User Id',Password from ProgramDetails.Subjects", cn)
           ada.SelectCommand = cmd
           ada.Fill(ds)
           GridView1.DataSource = ds.Tables(0)
       Catch ex As Exception
       End Try
  End Sub
  </code></pre>