Protected WithEvents lblfirstname As System.Web.UI.WebControls.Label
Protected WithEvents lbllastname As System.Web.UI.WebControls.Label
Protected WithEvents lblphone As System.Web.UI.WebControls.Label
Protected WithEvents lblemail As System.Web.UI.WebControls.Label
Protected WithEvents lblrentaladdress As System.Web.UI.WebControls.Label
Protected WithEvents lblpostalcode As System.Web.UI.WebControls.Label
Protected WithEvents lblintersection As System.Web.UI.WebControls.Label
Protected WithEvents lblarea As System.Web.UI.WebControls.Label
Protected WithEvents lbldateavailable As System.Web.UI.WebControls.Label
Protected WithEvents lbldescription As System.Web.UI.WebControls.Label
Protected WithEvents lbltype As System.Web.UI.WebControls.Label
Protected WithEvents lblrooms As System.Web.UI.WebControls.Label
Protected WithEvents lblbathrooms As System.Web.UI.WebControls.Label
Protected WithEvents lblprice As System.Web.UI.WebControls.Label
Protected WithEvents lbllivingarea As System.Web.UI.WebControls.Label
Protected WithEvents lblutilities As System.Web.UI.WebControls.Label
Protected WithEvents lblterm As System.Web.UI.WebControls.Label
Protected WithEvents lblpets As System.Web.UI.WebControls.Label
Protected WithEvents lblparking As System.Web.UI.WebControls.Label
Protected WithEvents lbllaundry As System.Web.UI.WebControls.Label
Protected WithEvents lblfridgestove As System.Web.UI.WebControls.Label
Protected WithEvents lblbalcony As System.Web.UI.WebControls.Label
Protected WithEvents lblaircond As System.Web.UI.WebControls.Label
Protected WithEvents lblfireplace As System.Web.UI.WebControls.Label
Protected WithEvents lblyard As System.Web.UI.WebControls.Label
Protected WithEvents lblfitnesscenter As System.Web.UI.WebControls.Label
Protected WithEvents lblpooljacoozi As System.Web.UI.WebControls.Label
Protected WithEvents lblstorage As System.Web.UI.WebControls.Label
Protected WithEvents lblbedrooms As System.Web.UI.WebControls.Label
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Dim itemid As Integer
'itemid = Int32.Parse(Request.Params("itemdid"))
itemid = 1
Dim conPubs As SqlConnection
Dim cmdSelect As SqlCommand
Dim dtrAuthors As SqlDataReader
' Retrieve records from database
conPubs = New SqlConnection("Server=localhost;Trusted_Connection=true;Database=findandview")
cmdSelect = New SqlCommand("Select firstname, lastname, phone,email, rentaladdress, postalcode, intersection, area, dateavailable,description, type, rooms, bathrooms, price, livingarea, utilities,term, pets, parking, laundry, fridgestove, balconydeck, aircond,fireplace, yard, fitnesscenter, pooljacuzzi, storage, bedrooms frommaintable where id='" & itemid & "'", conPubs)
'"Select * From maintable where color = '" & color.SelectedItem.Text.Trim & "'", conPubs)
conPubs.Open()
dtrAuthors = cmdSelect.ExecuteReader()
dtrAuthors.Read()
'sql statement...
'Select firstname, lastname, phone, email, rentaladdress, postalcode, intersection, area,
'dateavailable, description, type, rooms, bathrooms, price, livingarea, utilities, term,
'pets, parking, laundry, fridgestove, balconydeck, aircond,fireplace, yard, fitnesscenter, pooljacuzzi, storage, bedrooms)
dtrAuthors.GetString(0)
dtrAuthors.GetString(1)
dtrAuthors.GetString(2)
dtrAuthors.GetString(3)
dtrAuthors.GetString(4)
dtrAuthors.GetString(5)
dtrAuthors.GetString(6)
dtrAuthors.GetString(7)
dtrAuthors.GetString(8)
dtrAuthors.GetString(9)
dtrAuthors.GetString(10)
dtrAuthors.GetString(11)
dtrAuthors.GetString(12)
dtrAuthors.GetString(13)
dtrAuthors.GetString(14)
dtrAuthors.GetString(15)
dtrAuthors.GetString(16)
dtrAuthors.GetString(17)
dtrAuthors.GetString(18)
dtrAuthors.GetString(19)
dtrAuthors.GetString(20)
dtrAuthors.GetString(21)
dtrAuthors.GetString(22)
dtrAuthors.GetString(23)
dtrAuthors.GetString(24)
dtrAuthors.GetString(25)
dtrAuthors.GetString(26)
dtrAuthors.GetString(27)
dtrAuthors.GetString(28)
lblfirstname.Text = dtrAuthors.GetString(0)
lbllastname.Text = dtrAuthors.GetString(1)
lblphone.Text = dtrAuthors.GetString(2)
lblemail.Text = dtrAuthors.GetString(3)
lblrentaladdress.Text = dtrAuthors.GetString(4)
lblpostalcode.Text = dtrAuthors.GetString(5)
lblintersection.Text = dtrAuthors.GetString(6)
lblarea.Text = dtrAuthors.GetString(7)
lbldateavailable.Text = dtrAuthors.GetString(8)
lbldescription.Text = dtrAuthors.GetString(9)
lbltype.Text = dtrAuthors.GetString(10)
lblrooms.Text = dtrAuthors.GetString(11)
lblbathrooms.Text = dtrAuthors.GetString(12)
lblprice.Text = dtrAuthors.GetString(13)
lbllivingarea.Text = dtrAuthors.GetString(14)
lblutilities.Text = dtrAuthors.GetString(15)
lblterm.Text = dtrAuthors.GetString(16)
lblpets.Text = dtrAuthors.GetString(17)
lblparking.Text = dtrAuthors.GetString(18)
lbllaundry.Text = dtrAuthors.GetString(19)
lblfridgestove.Text = dtrAuthors.GetString(20)
lblbalcony.Text = dtrAuthors.GetString(21)
lblaircond.Text = dtrAuthors.GetString(22)
lblfireplace.Text = dtrAuthors.GetString(23)
lblyard.Text = dtrAuthors.GetString(24)
lblfitnesscenter.Text = dtrAuthors.GetString(25)
lblpooljacoozi.Text = dtrAuthors.GetString(26)
lblstorage.Text = dtrAuthors.GetString(27)
lblbedrooms.Text = dtrAuthors.GetString(28)
End Sub
End Class
The error may be because of null values from database. Check whther
the value of each item is null before assigning it.
You've commented out this line:
'itemid = Int32.Parse(Request.Params("itemdid"))
Were you supposed to?
0 comments:
Post a Comment