views:

33

answers:

1

Hi, 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 that 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?

+1  A: 

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

SLaks
I'm not sure i follow. What SQL query? Are you suggesting i cannot achieve the desired results by modifying the inline-code?
Grant
What does the data come from?
SLaks
If you're original query isn't returning the string value there is no way to show it on the page :-) You need to return the string field on you're sql query in order to show it. That's what SLaks wanted to say.
Claudio Redi