sqldatasource to Label control text in ASP.NET /VB

Discussion in 'ASP.NET / ASP.NET Core' started by quazter, Oct 5, 2011.

  1. How do you bind text in a label control from a sqldatasource? Thanks.
     
  2. Thanks, ended up using the following code and it works perfectly:

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim dv As New Data.DataView 'use the id of your SqlDataSource below' dv = SqlDataSource1.Select(DataSourceSelectArguments.Empty) Label1.Text = dv.Table.Rows(0)("LastUpdated") End Sub
     

Share This Page