title: How to get 1 column data from DataTable and display it to Lable using VB.Net on ASP.Net
body: <p>I want to get 1 column data from a DataTable that has multiple column and only 1 row record using VB.Net. And then display the column data into a web page using ASP.Net.</p>
  
  <p>In my case below, I want to get the Name column data from DataTable and then display it on a web page.</p>
  
  <p>Here my VB.Net Code:</p>
  
  <pre><code> Imports System
   Imports System.Data
   Imports System.Data.SqlClient
   Imports System.Configuration
  
  Public Class TestDisplayData
     Inherits System.Web.UI.Page
  
     Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
  
      'Create a Connection Object
      Dim connectionString As String
      Dim connection As SqlConnection
      connectionString = ConfigurationManager.ConnectionStrings("SQLDbConnection").ToString
      connection = New SqlConnection(connectionString)
  
      'Create SQL Command
      Dim SQL As String = "SELECT Name, Title, Phone FROM contacts"
  
      'Open the Connection
      connection.Open()
  
      'Create DataAdaptor Object
      Dim Adaptor As SqlDataAdapter = New SqlDataAdapter()
      Adaptor.SelectCommand = New SqlCommand(SQL, connection)
  
      'Close the Connection
      connection.Close()
  
      'Create DataTable Object
      Dim dt As DataTable = New DataTable()
  
      'Fill DataTable
      Adaptor.Fill(dt)
  
      'I am not sure what next code are. I want to get the Name column from the DataTable
  
  
     End Sub
  
   End Class
  </code></pre>
  
  <p>Here my HTML ASP.Net code:</p>
  
  <pre><code>&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head runat="server"&gt;
      &lt;title&gt;&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
     &lt;form id="form1" runat="server"&gt;
          &lt;div&gt;
              Name: (I want to display the Name column data here)
          &lt;/div&gt;
      &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>