开发者

How to access referenced table from ASPX in-line code (datagridview control)

开发者 https://www.devze.com 2022-12-28 06:05 出处:网络
i am trying to bind data to a datagridview control on an ASPX webpage and am using something like this..

i am trying to bind data to a datagridview control on an ASPX webpage and am using something like this..

<asp:TemplateField HeaderText="MyField">
    <ItemTemplate>
        <%# DataBinder.Eval(Container.DataItem, "MyField") %>
    </ItemTemplate>
</asp:TemplateField>

the problem i am having is that the data for the 'MyField' field is actually an integer t开发者_JS百科hat is a reference to a string value in another sql table.

Does anyone know how i can reformat my code line above to show the string value instead of the int value?


You need to change your SQL query to return the string using a JOIN.

0

精彩评论

暂无评论...
验证码 换一张
取 消