상세 컨텐츠

본문 제목

Run Custom Tool Dbml

카테고리 없음

by notvilade1970 2020. 2. 27. 16:11

본문

Hi,I have a.dbml file that I have dragged several tables on to from a database in the Server Explorer. I have written a lot of code against the model that was created.Now I have added another table (Companies) to the database and a Foreign Key in one of my existing tables (People) which references the PK of the new table. I have refreshed the Server Explorer and can see the new table and the new FK in my existing table.I can drag the new table on to the dbml workspace, no problem. But how do I make the new FK appear in the dbml class?

I have tried right-clicking on the.dbml file in the Solution Explorer and choosing 'Run Custom Tool' but that doesn't do anything. I supposeI could just delete the.dbml file and start all over again, but surely there is a better way! Eventually there will be dozens of tables involved and recreating every time one column changes in one table would be very painful.Please tell me that I am overlooking something simple.As a matter of interest, what if I went the other way and added or modifed a class in the dbml, can I get the database schema updated?thanks in advancePaulLinq to SQL.

Hi PaulLinton,As far as I know, you're unable to update the database scheme in LINQ designer - that's meaning you have to modify the scheme in designer when your table scheme in database changes. Image that you've changed the scheme of tableA in database, you don't need to delete all the tables and re-drag them from database. You just have to delete table A and re-drag it onto the designer - if need, create the FK associations.

Run Custom Tool Dbml

It's very easy for you when facing the scheme changing.Another thing I recommend is - you could implement the validation and logic in partial class. LINQ supports partial validation and logic which gives your application a high flexibility. In this case, you don't need to re-write thevalidation and logic when the scheme changes. It will save you much time.Hope this helps you!

Let me just say that this is pretty unbelievable (thinking of less PG13 words) that this is not built in. When more than one person works on the database am I supposed to guess what changed?!

Or you all live in a perfect world where everything is documentedand the database is created once and it's never changed?! Even the crappy Crystal Reports editor has a verify database that allows you to sync with the database schema! This should have been the FIRST feature to implement in the designer.

Will you guys stopchurning out crap, slow down, and polish things?! Arrrrrr :@. I totally agree.

I have 13 tables. I added a new table, and a foreign key. So naturally, I was hoping I could just remove / readd the table that I added the foreign key, as well as add in the new table. However, when I readded it, it lost about halfof it's foreign key relationships to tables I haven't touched! This is extremely painful. I have also custom named some of my foreign keys so they would make more sense (instead of the default way of appending numbers). Microsoft, would you please allowfor the model to refresh against the schema, also can you look at the name of the foreign key that's created in SQL and use that to create your foreign key name in the dbml, it gets really convoluted when a number is just appended on the end!.

I think/suspect that MSFT deliberately left out this feature to 'kill off' Linq to SQL with the RTM version of Entity Framework. (The EF designer has this feature, but I am not yet convinced that EF in its' current state is a better choice ofOR mapper than Linq2SQL. More on that in my blog over at )I'm not aware of any completely free re-sync tool for Linq2SQL (there may be, but to be honest I haven't foundany tool with this capability except mine).

.net Standard Dbml

Sqlmetal.exe download

I would like to give it away for free, but until the cost of developing and maintaining it has been covered I can not distribute it for free.(. = Although I have given away free unlimited licenses to a number of people who have either provided valuable feedback, or had a good reason why they shouldn't have to pay to use it.able to prove that they are full time students are one of the groups eligible for free licenses). They may have deliberately left out that feature since marketing decisions often drive their products (e.g., unit testing is only available in some versions of visual studio). Waiting for the Entity Framework is not an option. ORM technology is very matureand they all support lazy loading as a fundamental part of the architecture. Microsoft EF appears to bave been developed in a vacuum inside Microsoft by their own experts (they have none, they've never delivered a commerical ORM such as those that dominateon other platforms like TopLink, Hibernate and Java EE 3.0). If they do not support lazy loading, you're not talking about a replacement for LINQ 2 SQL you're talking about an entirely alien product.

The problem with LINQ 2 SQL is it does not really supportan n-tier model such as Java EE or Hibernate, but it's still a good product. Combined with their better-late-than-never unit testing, MVC (official release some time next year) and dependency injection (official support perhaps by the year 2025, if man isstill alive) they will eventually have a mainstream stack that can compete with 10 year old technology found on other platforms. RalphCEOI tried the Huagati tool. Aside from the $50 he is charging for the product, it is great for tables. But once your database is in production, how often do tables change?

I would think that stored procedures change more often. The Huagati tool does notupdate stored procedures. Now, if that was included with the product, I would pay the $50. I just uninstalled it. I am glad that I tried it first.FYI - Stored proc and UDF support is under way.

The latest release (v 1.75) has support for new and dropped stored procs and UDFs in the sync and compare functions. Support for modified stored procs is also coming soon.Update: As of ver 1.77 it also supports signature and return type/value changes in stored procedures, UDFs, SQL-CLR UDFs etc.