HELP! BC30545: Property access must assign to the property or use its value

Hi,

 

Im using a 4guysfromrolla sample to bind sqldatasource results to a label.  However Im getting the above error. 

Here is my code:

-----------------------------------------------------------------------------------------------------------------------------------
Imports
System.Data

Partial Class datareader

Inherits System.Web.UI.Page

Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load

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

Dim rndCoinFlip As New Random

RandomProductNames.Text = String.Empty

For Each dr As DataRow In dv.Table.Rows

'See if we want to show this

If rndCoinFlip.Next(2) = 0 Then

'Show

RandomProductNames.Text (dr("ProductName").ToString() & "<br />"

Else

'Don't show

End If

Next

End Sub

----------------------------------------------------------------------------------------------------------------------------------------------------------

Any thoughts????

 

Many Thanks

Fiorano

 

 

End Class

0
fiorano 4/22/2009 9:37:40 AM
📁 asp.net.getting-started
📃 91979 articles.
⭐ 7 followers.

💬 1 Replies
👁️‍🗨️ 168 Views

Hi,

fiorano:
RandomProductNames.Text (dr("ProductName").ToString() & "<br />"

Please replace the above code with this.

RandomProductNames.Text &= dr("ProductName").ToString() & "<br />"

 

 

I look forward to receiving your test results.

 

 


Sincerely,
Zong-Qing Li
Microsoft Online Community Support
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as
Answer” if a marked post does not actually answer your question.
0
Zong 4/24/2009 4:07:42 AM
Reply:
Similar Posts: