R
rn5a
A ASPX Form has a DataGrid & a Label. The Label resides outside the
DataGrid. The DataGrid displays records from a SQL Server database
table. The Label should display the value of a column named *CustName*
which will be common to all the records that the SQL query will
retrieve. This is the code:
========================================
Sub Button_Click(.....)
Dim dSet As DataSet
Dim strSQL As String
Dim sqlConn As SqlConnection
Dim sqlDapter As SqlDataAdapter
strSQL = "SELECT CustName,.........WHERE UserID = " &
Request.Form("UID")
sqlDapter = New SqlDataAdapter(strSQL, sqlConn)
dSet = New DataSet
sqlDapter.Fill(dSet, "MyTable")
MyDG.DataSource = dSet.Tables("MyTable").DefaultView
MyDG.DataBind()
End Sub
========================================
Now how do I display the *CustName* value in the Label control?
DataGrid. The DataGrid displays records from a SQL Server database
table. The Label should display the value of a column named *CustName*
which will be common to all the records that the SQL query will
retrieve. This is the code:
========================================
Sub Button_Click(.....)
Dim dSet As DataSet
Dim strSQL As String
Dim sqlConn As SqlConnection
Dim sqlDapter As SqlDataAdapter
strSQL = "SELECT CustName,.........WHERE UserID = " &
Request.Form("UID")
sqlDapter = New SqlDataAdapter(strSQL, sqlConn)
dSet = New DataSet
sqlDapter.Fill(dSet, "MyTable")
MyDG.DataSource = dSet.Tables("MyTable").DefaultView
MyDG.DataBind()
End Sub
========================================
Now how do I display the *CustName* value in the Label control?