Data Access problems

Results 1 to 2 of 2

Thread: Data Access problems

  1. #1
    Join Date
    Dec 1969

    Default Data Access problems

    Guys<BR>I am filling a datalist from an Access DB no problems at the moment. What i want to do is use different datalist based on the value of a certain field we are accessing. See code below<BR><BR>Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<BR> <BR> Dim propertyID As Long = (Request.QueryString("ID"))<BR> <BR> Dim FilePath As String<BR> FilePath = Server.MapPath("COM.mdb")<BR><BR> Dim myConnection As String = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source= &#039;" & FilePath & "&#039;"<BR> Dim DS As New DataSet<BR> Dim Cmd As New OleDbDataAdapter("Select * from Collins where ID = " & Request.QueryString("ID") & "", myConnection)<BR> Cmd.Fill(DS, "Collins")<BR> &#039;If Cmd("NumPhotos") = 3 Then<BR><BR> &#039; End If<BR> dl2.DataSource = DS<BR> dl2.DataBind()<BR><BR><BR> End Sub<BR><BR>Based on the value of NumPhotos i want to fill a different datalist, how can i incorporate this into my code

  2. #2
    Join Date
    Dec 1969

    Default RE: Data Access problems

    You need to access the value in the DataSet, not the Command.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts