tags:

views:

365

answers:

3

I am getting the following error for an item in a GridView: **A call to Bind was not well formatted. Please refer to documentation for the correct parameters to Bind. **

<ItemTemplate>
    <asp:LinkButton ID="lnkColumn" runat="server" CausesValidation="False" CommandName="Select"
        Text='<%# Bind("TableName.Column") %>' />
</ItemTemplate>

I can't work out why it works fine on my dev server, but not on the test machine. It also works on the production box? We are running ASP.NET 3.5 for the website.

+2  A: 

At the risk of being rude: Is it worth double checking your database schema, looking for a missing field? Is anything different between your environments? Try using winmerge to compare your environments (its great!)

Another idea: comment out the 'bind' row, and replace it with these, to get a better idea what's going on:

<%= Table.Field %> 
<%= Table.Field.GetType().ToString() %> 
<%= Table.GetType().ToString() %>
Chris
Schemas are the same - database is a restored version of the test server db. Website on test is the Published version,so no significant differences in files.
Anthony K
How about try my other new suggestion above then?
Chris
A: 

Hi, I have the same problem. With the integrated web server of visual studio on my dev pc works it fine binding to member objects, for example <%# Bind(Head.Name) %>.

On test server it works also, if I deploy it precompiled. But when I publish it updatable, then I am getting the error, saying Bind was not well formed!!!

Any ideas?

A: 

I found the solution. The test server was the only one without .NET 3.5 SP1. I installed the SP and rebooted - problem solved.

Anthony K