DB Value in Label



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 = " &

sqlDapter = New SqlDataAdapter(strSQL, sqlConn)

dSet = New DataSet
sqlDapter.Fill(dSet, "MyTable")

MyDG.DataSource = dSet.Tables("MyTable").DefaultView
End Sub

Now how do I display the *CustName* value in the Label control?


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads