Click here to Skip to main content
12,065,888 members (37,323 online)
Rate this:
 
Please Sign up or sign in to vote.
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 13-Feb-13 4:56am
sr_24484
Edited 13-Feb-13 6:55am
v3
Comments
richcb 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
subodhrastogi24 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.
subodhrastogi24 13-Feb-13 23:41pm
   
field name is same as in Table
Kiran Susarla 14-Feb-13 2:09am
   
Can you please paste your select query or the datasource object definition?
subodhrastogi24 14-Feb-13 2:42am
   
cmd.CommandText = "select CreatedDate 'Posted Date' ,JobTitle,Location,Job_Id,Category from JobForm ";

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

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'
  Permalink  
Comments
subodhrastogi24 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)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160207.1 | Last Updated 15 Feb 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100