syntax in sqldatasource selectcommand
Posted
by netNewbi3
on Stack Overflow
See other posts from Stack Overflow
or by netNewbi3
Published on 2010-04-07T12:38:20Z
Indexed on
2010/04/07
13:03 UTC
Read the original article
Hit count: 449
sqldatasource
|ASP.NET
Hi,
My SqlDataSource selectcommand is dynamically changed by the String.Format functionality of the Eval one-way databinding syntax. It works ok. However I need to put together two columns values with a space in the middle (ItemType + '" "' + ItemDescription As ItemInfo) but I can't get the syntax correct as I get the message: "The server tag is not well formed"
Can you help? Many thanks
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:conn %>" SelectCommand='<%# Eval("TypeID", "SELECT ItemID, ItemType, ItemType + '" "' + ItemDescription As ItemInfo WHERE ItemType = {0}")%>'>
</asp:SqlDataSource>
© Stack Overflow or respective owner