Here's the ASP code
<table >
<tr>
<td class="style5">
<asp:Label ID="lblProperty" runat="server" Text="Property:"></asp:Label>
</td>
<td class="style6">
</td>
<td class="style4">
<asp:DropDownList ID="cbxProperty" runat="server" Width="250px">
</asp:DropDownList>
</td>
</tr>
Here's the VB code to load the information. I've checked the SQL directly against the database, and it works, so I can't figure out where the issue is.
Private Sub LoadProperties()
Dim db As New ScoreCardDataContext
Dim ds As New DataSet()
Dim Properties = From p In db.zProperties
Where p.Active = True
Select p
Dim command As SqlCommand = db.GetCommand(Properties)
Dim adapter As SqlDataAdapter = New SqlDataAdapter(command)
adapter.Fill(ds)
Me.cbxProperty.DataSource = ds
Me.cbxProperty.DataTextField = "Property"
Me.cbxProperty.DataValueField = "PropertyID"
Me.cbxProperty.DataBind()
End Sub
Public Sub CheckforProperty()
Dim db As New ScoreCardDataContext
Dim ds As New DataSet()
Dim UserPropertyList = From P In db.PropertyPortfolios
Where P.PersonID = intPersonID
Select P
Dim command As SqlCommand = db.GetCommand(UserPropertyList)
Dim adapter As SqlDataAdapter = New SqlDataAdapter(command)
adapter.Fill(ds)
If ds.Tables(0).Rows.Count = 0 Then
LoadProperties()
Me.pnlSelectProperty.Visible = True
Else
Me.pnlSelectProperty.Visible = False
End If
End Sub
Thanks

New Topic/Question
Reply




MultiQuote







|