Evening SO,
I'm running in to the above error when trying to update a gridview with a drop down list. However, this only happens depending on how I arrange my dataset.
The following SQL gives me an error:
"SELECT top 1 M.Title, H.* FROM MASTER AS M
RIGHT JOIN History AS H
ON M.TITLE = H.TITLE
WHERE [Type] < '3'
order by h.upd_date_time desc"
However, if I remove the 'desc' from the script then the web page will work without error. For reference I'm using the following script for the DDL:
<asp:TemplateField HeaderText="Edge 1" SortExpression="Edge1">
<EditItemTemplate>
<asp:DropDownList
ID="DDL1" runat="server" DataSourceID="OKNGSelect" DataTextField="col1"
DataValueField="col1" SelectedValue='<%# Bind("Edge1") %>' AppendDataBoundItems="true">
<asp:ListItem Text="Select" Value="" />
</asp:DropDownList>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("Edge1") %>'></asp:Label>
</ItemTemplate>
<ItemStyle Wrap="False" />
</asp:TemplateField>
Is there a way to fix this at the SQL side as I need the most recent record to display from my history table on its own? I've tried fixing it from the asp page side but after some extensive research on the net it seems this is an uncommon but very elusive fault to deal with.
Thanks.