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
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

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

  • 04-05-2012 01:49PM
    #1
    Registered Users, Registered Users 2 Posts: 4,325 ✭✭✭


    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, Paid Member Posts: 43,914 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, Registered Users 2 Posts: 4,325 ✭✭✭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, Registered Users 2 Posts: 4,325 ✭✭✭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