开发者

Designer.cs is deleted on adding object in DBML

开发者 https://www.devze.com 2022-12-18 18:36 出处:网络
My original dbml file had objects which had data connection to other server/db. As my db is changed to different server and i want to update my spproc when i delete the spproc and drag the new one dbm

My original dbml file had objects which had data connection to other server/db. As my db is changed to different server and i want to update my spproc when i delete the spproc and drag the new one dbml.designer.cs is deleted. I a开发者_StackOverflow中文版m using VS 2008 SP1. I can't regenerate all my dbmls as they have lots of tables, sps etc.. Inserting the using inside the dbml namespace doesn't resolve my issue.


I just ran into this same problem. Bizarrely, the solution is to move any using statements into the namespace brackets.

For example, I had this (with the using statement at the top like you would normally see):

using System.Configuration;
namespace BuildDashboard.Data
{
    partial class DashboardDBDataContext
    {
        ...
    }
}

And I had to change it to this (With the using statement inside the namespace):

namespace BuildDashboard.Data
{
    using System.Configuration;

    partial class DashboardDBDataContext
    {
        ...
    }
}

Once I made this change, my designer file was no longer deleted.

0

精彩评论

暂无评论...
验证码 换一张
取 消