I'm creating an UPDATE database page. The database is MS Access. The page works fine. The user selects which entry to update by selecting the title of the entry from a drop down menu. I want the titles to be in alphabetical order. But when I use a ORDER BY, it doesn't put them in alphabetical order. Is there a conflict with the WHERE statement? I've tried setting up the SELECT with both "*" and complete field names, but neither makes a difference. How do I get the titles to be ordered?
Dawn
Code:
...
ddlPolicies.DataValueField = "PolicyID";
ddlPolicies.DataTextField = "Title";
ddlPolicies.DataBind();
objRdr.Close();
dbConn.Close();
}}
void SelectPolicy(Object s, EventArgs e) {
objCmd = new OleDbCommand("SELECT [PFFPolicies].[PolicyID], [PFFPolicies].[Manual], [PFFPolicies].[PageNumber], [PFFPolicies].[Title], [PFFPolicies].[Notes], [PFFPolicies].[Link], [PFFPolicies].[LastUpdated] FROM [PFFPolicies] WHERE [PFFPolicies].[PolicyID]=@PolicyID ORDER BY [PFFPolicies].[Title]", dbConn);
objCmd.Parameters.Add("@PolicyID", ddlPolicies.SelectedItem.Value);
dbConn.Open();
objRdr = objCmd.ExecuteReader();
...
Dawn