Click here to Skip to main content
Rate this: bad
good
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 at 13-Feb-13 9:59am
   
Your error message shows CreateddDate. It contains an extra "d". Remove that d and see what happens.
Sandeep Mewara at 13-Feb-13 11:51am
   
+5
subodhrastogi24 at 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 at 13-Feb-13 12:21pm
   
You need to find appropriate name of field.
subodhrastogi24 at 13-Feb-13 23:41pm
   
field name is same as in Table
Kiran Susarla at 14-Feb-13 2:09am
   
Can you please paste your select query or the datasource object definition?
subodhrastogi24 at 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 at 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
0 OriginalGriff 330
1 Sergey Alexandrovich Kryukov 279
2 BillWoodruff 245
3 Afzaal Ahmad Zeeshan 215
4 CPallini 205
0 OriginalGriff 5,635
1 DamithSL 4,496
2 Maciej Los 3,942
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,180


Advertise | Privacy | Mobile
Web04 | 2.8.141216.1 | Last Updated 15 Feb 2013
Copyright © CodeProject, 1999-2014
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