I am trying to get a drop down list to populate with the results of an SQL query.
Here is the code.
sql = "SELECT Order_no FROM ORDERS WHERE Cust_no ='" & idtext & "'"
Cmd = New OleDb.OleDbCommand(Sql, Con)
Con.Open()
reader = cmd.ExecuteReader(CommandBehavior.CloseConnection)
ddorder.DataSource = reader
ddorder.DataBind()
Con.close()
ddorder is a drop down list. the list gets populated, but it is populated by titles such as System.Data.Commom.DBdatarecord
Ideas?
Edit: I just noticed that the form is kicking out an error that no data exists for my query. The datatable is populated. I don't know why it wouldn't find anything. Its wierd cause there will be a number of items in the DD box that is equal to the number of records that should turn up, but the are all titled System.Data.Commom.DBdatarecord
Here is the code.
sql = "SELECT Order_no FROM ORDERS WHERE Cust_no ='" & idtext & "'"
Cmd = New OleDb.OleDbCommand(Sql, Con)
Con.Open()
reader = cmd.ExecuteReader(CommandBehavior.CloseConnection)
ddorder.DataSource = reader
ddorder.DataBind()
Con.close()
ddorder is a drop down list. the list gets populated, but it is populated by titles such as System.Data.Commom.DBdatarecord
Ideas?
Edit: I just noticed that the form is kicking out an error that no data exists for my query. The datatable is populated. I don't know why it wouldn't find anything. Its wierd cause there will be a number of items in the DD box that is equal to the number of records that should turn up, but the are all titled System.Data.Commom.DBdatarecord