Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/unit-testing/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net sqldatasource selectcommand中的语法_Asp.net_Sqldatasource - Fatal编程技术网

Asp.net sqldatasource selectcommand中的语法

Asp.net sqldatasource selectcommand中的语法,asp.net,sqldatasource,Asp.net,Sqldatasource,我的SqlDataSource selectcommand由Eval单向数据绑定语法的String.Format功能动态更改。它工作正常。但是,我需要把两个列值放在中间的ItMyType + ''+iTimeDeals'作为ITEMFILL中,但是当我得到消息时,我不能得到正确的语法:服务器标签没有很好地形成 你能帮忙吗?非常感谢 这可能是一个更普遍的问题 <asp:SqlDataSource ID="SqlDataSource1" runat="server" C

我的SqlDataSource selectcommand由Eval单向数据绑定语法的String.Format功能动态更改。它工作正常。但是,我需要把两个列值放在中间的ItMyType + ''+iTimeDeals'作为ITEMFILL中,但是当我得到消息时,我不能得到正确的语法:服务器标签没有很好地形成

你能帮忙吗?非常感谢


这可能是一个更普遍的问题

 <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
         ConnectionString="<%$ConnectionStrings:conn %>" 
         SelectCommand='<%# Eval(&quot;TypeID&quot;, &quot;SELECT ItemID, ItemType, ItemType + &quot;\" \"&quot; + ItemDescription As ItemInfo WHERE ItemType = {0}&quot;)%>'> 
 </asp:SqlDataSource>

HiI按照中的建议以这种方式解决了问题

在items.aspx.vb中

Protected Const SqlQuery As String=选择ItemID、ItemType、ItemType++''+ItemDescription作为ItemInfo,其中ItemType={0}

在items.aspx中

非常感谢

那么这不是问题,而是问题