Dovberman
asked on
SQL Statement in ASPX page containing a greater than condition is confused with an HTML Tag.
SQL Statement in an ASPX page containing a greater than condition is confused with an HTML Tag.
Works in SQL Server management studio
SELECT TOP 1 Symbol.SecName,Symbol.Symb olName,
TrendGroup.SymbolID
FROM Market INNER JOIN
Symbol ON Market.MarketID = Symbol.MarketID INNER JOIN
TrendGroup ON Symbol.SymbolID = TrendGroup.SymbolID
WHERE Symbol.Active=1 AND Symbol.MarketID=1
AND TGStartDate > '06/28/2007'
ORDER BY TGStartDate DESC
Fails in ASPX SelectCommand
<asp:SqlDataSource ID="dscPickToWatch" runat="server"
ConnectionString="MyConnec tionString "
ProviderName="System.Data. SqlClient"
SelectCommand="SELECT TOP 1 Symbol.SecName,Symbol.Symb olName,
TrendGroup.SymbolID
FROM Market INNER JOIN
Symbol ON Market.MarketID = Symbol.MarketID INNER JOIN
TrendGroup ON Symbol.SymbolID = TrendGroup.SymbolID
WHERE Symbol.Active=1 AND Symbol.MarketID=1
AND TGStartDate > '06/28/2007'
ORDER BY TGStartDate DESC " >
</asp:SqlDataSource>
TGStartDate = '06/28/2007' Works.
I believe the ">" sign is interpreted as an HTML tag.
Works in SQL Server management studio
SELECT TOP 1 Symbol.SecName,Symbol.Symb
TrendGroup.SymbolID
FROM Market INNER JOIN
Symbol ON Market.MarketID = Symbol.MarketID INNER JOIN
TrendGroup ON Symbol.SymbolID = TrendGroup.SymbolID
WHERE Symbol.Active=1 AND Symbol.MarketID=1
AND TGStartDate > '06/28/2007'
ORDER BY TGStartDate DESC
Fails in ASPX SelectCommand
<asp:SqlDataSource ID="dscPickToWatch" runat="server"
ConnectionString="MyConnec
ProviderName="System.Data.
SelectCommand="SELECT TOP 1 Symbol.SecName,Symbol.Symb
TrendGroup.SymbolID
FROM Market INNER JOIN
Symbol ON Market.MarketID = Symbol.MarketID INNER JOIN
TrendGroup ON Symbol.SymbolID = TrendGroup.SymbolID
WHERE Symbol.Active=1 AND Symbol.MarketID=1
AND TGStartDate > '06/28/2007'
ORDER BY TGStartDate DESC " >
</asp:SqlDataSource>
TGStartDate = '06/28/2007' Works.
I believe the ">" sign is interpreted as an HTML tag.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER