I've been searching Google for 2 days.
I'm trying to get a gridview on a page and it's just not working. I've done this hundreds of times on this site, never a problem. This is not a matter of a missing field in the SQLDataSource. The query runs fine in the "configure datasource" wizard.
Here is the gridview. I took out the rest of the fields.
<asp:GridView ID="GridView1"
runat="server"
AllowPaging="True"
AllowSorting="True"
AutoGenerateColumns="False"
PageSize="200"
GridLines="Vertical"
CellPadding="4"
Font-Size="Medium"
CssClass="gridviewPageGRID"
DataSourceID="SqlDataSource1"
DataKeyNames="Address_Hash">
<Columns>
<asp:TemplateField HeaderText="Address" SortExpression="Address">
<ItemTemplate>
<asp:Label ID="l3" runat="server" Text='<%# Eval("Address")%>'/>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
Here is the SQLDataSource:
SELECT CASE COALESCE(POBox,'')
WHEN '' THEN
Street_Number
+ ' ' + Street_PreDir
+ ' ' + Street_Name
+ ' ' + Street_Suffix
+ ' ' + Street_PostDir
+ '<br />' + City
+ ', ' + State
+ ' ' + ZIP
ELSE
'PO Box ' + POBox
+ '<br />' + City
+ ', ' + State
+ ' ' + ZIP
END AS Address
FROM ERP.dbo.A_Address_Master
This SQL has worked fine on other pages in the site. The *only* field returned is Address, so why is this bombing? The SQL works in Toad, it works in setting up the data source in VS, so what's wrong with the gridview?