View Single Post
  #2 (permalink)  
Old January 16th, 2008, 10:36 AM
wehttam42 wehttam42 is offline
Registered User
 
Join Date: Jan 2008
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Try this:
I have a sqlDataSource which returns a single row and a single column (its looking up a user's name based on the authenticated name on for the page)

First, assign the results of the sqlDataSource to a dataview.
Then assign the first item (row) of the dataview to a datarowview.
Then assign the column (UserName in my case) to the text of your label.

Dim dv As DataView = CType(SqlDataSource1.Select(DataSourceSelectArgume nts.Empty), DataView)

Dim dr As DataRowView = dv.Item(0)

lblUserName.Text = dr.Item("UserName")