2 Replies - 2687 Views - Last Post: 14 November 2012 - 06:15 AM Rate Topic: -----

#1 beegee  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 20-October 08

operator & not defined for string "select...." and data ro

Posted 09 November 2012 - 03:00 AM

i have 2 ddls and i want to populate the second one based on the value of the first one. so i went on to use a row filter to filter the data view to get the data i need on the second ddl but when the page loads i get the error operator & not defined for string "Select distinct Zones....." and data row view. i click ok on the dialog error box to close it and it goes on to open the form and the code actually works. so how do i get rid of the error

cmd.CommandText = "Select Distinct Zones.ZoneID,CustomerItems.CustomerID as CustomerID,Zones.Zone " & _
"From CustomerItems Inner Join Zones On Zones.ZoneID=CustomerItems.ZoneID " & _
"Inner Join StockItems On StockItems.StockID=CustomerItems.StockID Where CustomerItems.CustomerID='" & ddlCustomers.SelectedValue & "'"
da = New SqlDataAdapter(cmd)
da.Fill(ds, "Zones")

'Populate Zones
ddlZone.DisplayMember = "Zone"
ddlZone.ValueMember = "ZoneID"
ddlZone.DataSource = ds.Tables("Zones")


setup = False
If Not setup Then
Dim dv As DataView
dv = New DataView(ds.Tables("Zones"))
'dv.RowFilter = "CustomerID = '" & ddlCustomers.SelectedValue & "'"
dv.RowFilter = "[CustomerID] = " & ddlCustomers.SelectedValue
ddlZone.DataSource = dv
ddlZone.ValueMember = "ZoneID"
ddlZone.DisplayMember = "Zone"
setup = False
End If


This post has been edited by Martyr2: 10 November 2012 - 11:37 AM
Reason for edit:: Please use code tags in the future, thanks! :)


Is This A Good Question/Topic? 0
  • +

Replies To: operator & not defined for string "select...." and data ro

#2 Martyr2  Icon User is offline

  • Programming Theoretician
  • member icon

Reputation: 4332
  • View blog
  • Posts: 12,127
  • Joined: 18-April 07

Re: operator & not defined for string "select...." and data ro

Posted 10 November 2012 - 11:43 AM

What line does it actually stop on when it gives you the error? It should be highlighting a row. :)
Was This Post Helpful? 0
  • +
  • -

#3 beegee  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 20-October 08

Re: operator & not defined for string "select...." and data ro

Posted 14 November 2012 - 06:15 AM

it pops up on a dialog box when the page loads.it doesnt highlight any row
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1