Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 606389
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T17:14:57+00:00 2026-05-13T17:14:57+00:00

I have this really random problem with is bugging me. It works at the

  • 0

I have this really random problem with is bugging me. It works at the end of the day but the problem took some time to figure out and was wondering why this happens so if anyone shed some light on the subject I would be really grateful. Here is the problem

I have the following two columns on my datagrid

<asp:boundcolumn
datafield="contentsection.Id"
headerstyle-cssclass="dgHead"
headertext="Section"
itemstyle-cssclass="dgItem" />

and

<asp:templatecolumn>
<itemtemplate><%#Eval("contentsection.Id") %></itemtemplate>
</asp:templatecolumn>

The first column gives me the error of:

A field or property with the name ‘contentsection.Id’ was not found on the selected data source

but the second on runs fine. Any ideas or theories as to why this is happening ?

The way that I call and bind my data is like so:

Page Load Code Behind

ContentList.DataSource = ContentBlockManager.GetList();
ContentList.DataBind();

The GetList() function it is overloaded and by default passed a 0

public static List<ContentBlockMini> GetList(int SectionId)
{
    List<ContentBlockMini> myList = null;

    SqlParameter[] parameters = { new SqlParameter("@ContentSectionId", SectionId) };

    using (DataTableReader DataReader = DataAccess.GetDataTableReader("dbo.contentblock_get", parameters))
    {
        if (DataReader.HasRows)
        {
            myList = new List<ContentBlockMini>();
        }
        while (DataReader.Read())
        {
            myList.Add(FillMiniDataRecord(DataReader));
        }
    }

    return myList;
}

and my filling of the data record. The ContentSection is another Object Which is a property of the ContentBlock object

private static ContentBlockMini FillMiniDataRecord(IDataRecord DataRecord)
        {
            ContentBlockMini contentblock = new ContentBlockMini();

            contentblock.Id = DataRecord.GetInt32(DataRecord.GetOrdinal("Id"));
            contentblock.Name = DataRecord.GetString(DataRecord.GetOrdinal("Name"));
            contentblock.SEOKeywords = DataRecord.IsDBNull(DataRecord.GetOrdinal("SEOKeywords")) ? string.Empty : DataRecord.GetString(DataRecord.GetOrdinal("SEOKeywords"));
            contentblock.SEODescription = DataRecord.IsDBNull(DataRecord.GetOrdinal("SEODescription")) ? string.Empty : DataRecord.GetString(DataRecord.GetOrdinal("SEODescription"));
            if (DataRecord.GetInt32(DataRecord.GetOrdinal("ContentSectionId")) > 0)
            {
                ContentSection cs = new ContentSection();
                cs.Id = DataRecord.GetInt32(DataRecord.GetOrdinal("ContentSectionId"));
                cs.Name = DataRecord.IsDBNull(DataRecord.GetOrdinal("ContentSectionName")) ? string.Empty : DataRecord.GetString(DataRecord.GetOrdinal("ContentSectionName"));
                contentblock.contentsection = cs;

            }
            return contentblock;
        }

There you go that is pretty much the start to end.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T17:14:57+00:00Added an answer on May 13, 2026 at 5:14 pm

    The “Bind” marker is a two-way bind and is made using the default namespace attached to the datasource of the object. This can’t be overridden, and because of this tightly coupled connection the namespace should be left off as assumed (since it’s dynamically pulled from the datasource).

    Eval is a one-way binding that can be used with any namespace that will fulfill a proper evaluation. Dates, strings, method calls, etc. The namespace provided in your example just provides eval with a marker on where to get the data relevant.

    The key here is the nature of the binding. Eval is a “fire and forget” sort of binding where as Bind is more rigid to facilitate the two-way.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.