locked
DBML refresh? RRS feed

  • Question

  • User-464228023 posted

    Dear folks,

    In my DD project I used the L2S class to create the model. I had my table field vendor_name initially set to allow nulls. However, I later set it to not allow null and after that trying to insert a record with null in vendor_name threw up this exception :-

    Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: Cannot insert the value NULL into column 'vendor_name', table 'necinvdev.dbo.vendor'; column does not allow nulls. INSERT fails.
    The statement has been terminated.

    instead of the validation message I expected.

    Obviously, the dbml didn't update itself with my changes in the vendor_name field. How do I refresh the dbml when I change/add/delete fields and tables?

     

    Tuesday, July 28, 2009 8:19 AM

Answers

  • User-330204900 posted

     Hi mnongkhlaw, you first delete the table save and then re-add the table [:D]

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, July 28, 2009 2:26 PM
  • User-1327538587 posted

    Following what Steve suggested once you have deleted the table click the database explorer tab and right click the Data Connection you're using, then right click the Tables folder and Refresh, Then drag your table back onto your model (or readd however you normally do). 

    I found working in SQL Server 2000,2005 and express2008 that the connection contents were stale and I would constantly be frustrated adding/removing tables to the model without the changes I had made in the database being reflected.

    Once I got in the habit of doing this I didn't have any more problems.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, July 28, 2009 3:03 PM

All replies

  • User-330204900 posted

     Hi mnongkhlaw, you first delete the table save and then re-add the table [:D]

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, July 28, 2009 2:26 PM
  • User-1327538587 posted

    Following what Steve suggested once you have deleted the table click the database explorer tab and right click the Data Connection you're using, then right click the Tables folder and Refresh, Then drag your table back onto your model (or readd however you normally do). 

    I found working in SQL Server 2000,2005 and express2008 that the connection contents were stale and I would constantly be frustrated adding/removing tables to the model without the changes I had made in the database being reflected.

    Once I got in the habit of doing this I didn't have any more problems.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, July 28, 2009 3:03 PM
  • User-464228023 posted

    Yeah, I found that out after I posted. It looks like there's no autorefresh feature of the DBML. Anyway, thanks a ton to both of you.

    Wednesday, July 29, 2009 5:42 AM
  • User-587630019 posted

    Helpful note on refreshing a table. Thanks.

    Tuesday, November 29, 2011 3:27 PM