Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Error--

DataBinding: 'System.Data.Common.DataRecordInternal' does not contain a property with the name 'CreateddDate'.

Code--
where "CreatedDate" of "DateTime" datatype column of in sqlserver table

and aspx page code is ----
<asp:GridView ID="Grid_PostedJobs" runat="server" AutoGenerateColumns="False" Height="175px" Width="673px" DataKeyNames="Job_Id"  >
  <Columns>
    <asp:TemplateField HeaderText="Posted Date" Visible="true">
       <ItemTemplate>
          <asp:Label ID="lbl_Date" runat="server" Text='<%#
                 Bind("CreatedDate", "{0:M-dd-yyyy}")%>'>
          </asp:Label>
        </ItemTemplate>
    </asp:TemplateField>
</Columns>
    </asp:GridView>
Posted
Updated 13-Feb-13 5:55am
v3
Comments
Richard C Bishop 13-Feb-13 9:59am    
Your error message shows CreateddDate. It contains an extra "d". Remove that d and see what happens.
Sandeep Mewara 13-Feb-13 11:51am    
+5
sr_24 13-Feb-13 11:53am    
It is still showing the same error---- richcb
DataBinding: 'System.Data.Common.DataRecordInternal' does not contain a property with the name 'CreatedDate'.
Maciej Los 13-Feb-13 12:21pm    
You need to find appropriate name of field.
sr_24 13-Feb-13 23:41pm    
field name is same as in Table

1 solution

I think you have renamed your CreatedDate column with 'PostedDate' as shown your Select query which you have posted here:
cmd.CommandText = "select CreatedDate 'PostedDate' ,JobTitle,Location,Job_Id,Category from JobForm ";


If this this the right query then you have to use 'PostedDate' on Data Bind method instead of 'CreatedDate'
 
Share this answer
 
Comments
sr_24 18-Feb-13 4:00am    
thanks MDubey87

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900