Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

A field or property with the name was not found on the selected data source

Options
  • 04-05-2012 1:49pm
    #1
    Registered Users Posts: 4,012 ✭✭✭


    I have an ASP.NET datagridview that was created some time ago and I want to display an extra column in it (I have a new field in the table that it is linked to).
    It should be quite simple;it was bound by a wizard so all I had to do was re-configure the data source to include this extra field.
    However it keeps giving me the error:
    "A field or property with the name <Name here> was not found on the selected data source".
    The field is selected,it DOES exist (the query executes perfectly in SQL Managment Studio) and the name is correct.
    I have tried everything to get this to work but it's the same error all the time.
    Is there any other grid control I can use as I am fed up with this?


Comments

  • Moderators, Politics Moderators Posts: 39,589 Mod ✭✭✭✭Seth Brundle


    Are you sure that some form of alias isn't being used and/or the spelling of the field name in the datagrid is correct?


  • Registered Users Posts: 4,012 ✭✭✭lukin


    kbannon wrote: »
    Are you sure that some form of alias isn't being used and/or the spelling of the field name in the datagrid is correct?

    No, there's no alias being used and the name is the same in the grid as it is in the table. I think it must be caching it somewhere because just for a test just now I changed the datasource of the grid to be just one field from the table but it displayed as before (all the fields from the table).
    I am running it off localhost btw


  • Registered Users Posts: 4,012 ✭✭✭lukin


    I found out what it was; there was some extra code in the .cs page that modified the datasource of the grid (overriding what was set in the .aspx page).:mad:


Advertisement