
May 8th, 2003, 08:15 PM
|
|
Registered User
|
|
Join Date: May 2003
Posts: 3
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
No result be shown in List, plzzzzzzzzz help
<img border="0" src="/forum/emoticons/jumpin.gif" height="31" width="31" alt="jumpin" /> <br><br>Hello,<br><br>I'm using ASP.net to build a Mobile page. I want to get data from SQL and show the data in the mobile List, however, List never comes out.... and no data at all.<br>Here is my coding:<br><br>Private Sub SightSeeingSpot_Activate(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SightSeeingSpot.Activate<br><br> Dim conn As SqlConnection = New SqlConnection("Server=localhost;UID='sa';PWD='';Database=Hotel")<br> Dim sql As String = "Select * from Sightseeing where name = '" & SelectionList2.Selection.Text & "' "<br> Dim dr As New SqlCommand(sql, conn)<br> Dim reader As SqlDataReader<br> Dim values As ArrayList = New ArrayList()<br><br> conn.Open()<br> reader = dr.ExecuteReader()<br> While reader.Read()<br> values.Add(reader.Item("Location").ToString())<br> End While<br> List1.DataSource = values<br> List1.DataMember = "Sightseeing"<br> List1.DataBind()<br> conn.Close()<br> reader.Close()<br><br> End Sub<br><br>Could anyone be kind to advise me how to solve the problem? I'm really in a hurry.......... Plzzzzzzzzzzzzzzzzzzzzzz help.... Many many thx.<br><br>Winnie
|