R
RN1
Sub Page_Load(........)
If Not Page.IsPostBack Then
Call LoadData()
End If
End Sub
Sub LoadData()
Dim dSet As DataSet
Dim sqlConn As SqlConnection
Dim sqlDapter As SqlDataAdapter
sqlConn = New SqlConnection("............")
sqlDapter = New SqlDataAdapter("SELECT * FROM ETS", sqlConn)
dSet = New DataSet
sqlDapter.Fill(dSet, "ETS")
dgETS.DataSource = dSet.Tables("ETS").DefaultView
dgETS.DataBind()
End Sub
----------------------------------
Suppose the SQL SELECT query doesn't output any records i.e. the
database table is empty. How do I show a "No Records Found" message in
a Label to the user?
Thanks,
Ron
If Not Page.IsPostBack Then
Call LoadData()
End If
End Sub
Sub LoadData()
Dim dSet As DataSet
Dim sqlConn As SqlConnection
Dim sqlDapter As SqlDataAdapter
sqlConn = New SqlConnection("............")
sqlDapter = New SqlDataAdapter("SELECT * FROM ETS", sqlConn)
dSet = New DataSet
sqlDapter.Fill(dSet, "ETS")
dgETS.DataSource = dSet.Tables("ETS").DefaultView
dgETS.DataBind()
End Sub
----------------------------------
Suppose the SQL SELECT query doesn't output any records i.e. the
database table is empty. How do I show a "No Records Found" message in
a Label to the user?
Thanks,
Ron