473,388 Members | 1,426 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Refresh Linq Data Entities in the Model

hi there,

i have generated a database model using vs and a *.dbml file. there are
a lot of tables in the database and all of them are prefixed, like
xxCustomers, xxOrders. for the generated entities i don't want those
prefixes so i removed them in the design view of the model which works
fine. my problem now is, that we are still changing little bits in the
table definitions (adding columns, renaming them and the like), and i
need to "refresh" the model. but while doing so, i don't want all
classes to be newly created (and have the table-prefix again). is there
a way to do this?

thanks for any help in advance.

matthias
--

Jun 27 '08 #1
13 3221
Matthias S. wrote:
hi there,

i have generated a database model using vs and a *.dbml file. there
are a lot of tables in the database and all of them are prefixed, like
xxCustomers, xxOrders. for the generated entities i don't want those
prefixes so i removed them in the design view of the model which works
fine. my problem now is, that we are still changing little bits in the
table definitions (adding columns, renaming them and the like), and i
need to "refresh" the model. but while doing so, i don't want all
classes to be newly created (and have the table-prefix again). is
there a way to do this?

thanks for any help in advance.
No, linq to sql doesn't support model refreshing in the designer.

FB
--
------------------------------------------------------------------------
Lead developer of LLBLGen Pro, the productive O/R mapper for .NET
LLBLGen Pro website: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
Jun 27 '08 #2
hi frans,

thanks for your reply. is there a workaround? i mean, things change in
a development cycle, or not? what you've said seems to render the whole
database model thing useless.

kind regards,

matthias
--

Frans Bouma [C# MVP] wrote:
Matthias S. wrote:
hi there,

i have generated a database model using vs and a *.dbml file. there
are a lot of tables in the database and all of them are prefixed,
like xxCustomers, xxOrders. for the generated entities i don't want
those prefixes so i removed them in the design view of the model
which works fine. my problem now is, that we are still changing
little bits in the table definitions (adding columns, renaming them
and the like), and i need to "refresh" the model. but while doing
so, i don't want all classes to be newly created (and have the
table-prefix again). is there a way to do this?

thanks for any help in advance.

No, linq to sql doesn't support model refreshing in the designer.

FB
Jun 27 '08 #3
Remove and re-add the table, or (more likely) hand-edit the dbml (xml) file.

I believe the Entity Framework designer is a bit more intelligent (I
haven't got CTP machine handy, but I'm sure I've seen a button to do
this; can't say for sure though...) - and it /could/ (pure speculation)
be that the LINQ-to-SQL designer inherits some of this capability when
the VS2008 update ships later this year. Maybe.

Marc
Jun 27 '08 #4
Matthias S. wrote:
hi frans,

thanks for your reply. is there a workaround? i mean, things change in
a development cycle, or not? what you've said seems to render the
whole database model thing useless.
You know, your post made me think abit about shipping a set of
templates for LLBLGen Pro to generate linq to sql code/mapping file.
Our designer does support model updates when databases change.

Other than that, I don't know of any workaround other than re-building
the model in the vs.net designer. I also agree with you that not having
this merge feature is really a big oversight.

FB

--
------------------------------------------------------------------------
Lead developer of LLBLGen Pro, the productive O/R mapper for .NET
LLBLGen Pro website: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
Jun 27 '08 #5
Hi Marc,

thanks for your reply. Yes, even after doing some research on it, if
come to the point that hand-editing (either the model by adding or
removing columns/properties or directly the dbml file) is the only way
it works. Pretty sad though. It makes the whole dbml thing not much
better then any external O/R Mapper tool.

Kind regards. Matthias
--

Marc Gravell wrote:
Remove and re-add the table, or (more likely) hand-edit the dbml
(xml) file.

I believe the Entity Framework designer is a bit more intelligent (I
haven't got CTP machine handy, but I'm sure I've seen a button to do
this; can't say for sure though...) - and it could (pure speculation)
be that the LINQ-to-SQL designer inherits some of this capability
when the VS2008 update ships later this year. Maybe.

Marc
Jun 27 '08 #6
Hi Frans,

thanks again for your feedback. I think we can agree on the point that
without any sync-capabilities the dbml thing is pretty useless. You
should hit the market with your templates :)

Kind regards. Matthias
--

Frans Bouma [C# MVP] wrote:
Matthias S. wrote:
hi frans,

thanks for your reply. is there a workaround? i mean, things change
in a development cycle, or not? what you've said seems to render the
whole database model thing useless.

You know, your post made me think abit about shipping a set of
templates for LLBLGen Pro to generate linq to sql code/mapping file.
Our designer does support model updates when databases change.

Other than that, I don't know of any workaround other than
re-building the model in the vs.net designer. I also agree with you
that not having this merge feature is really a big oversight.

FB
Jun 27 '08 #7
Matthias S. wrote:
Hi Frans,

thanks again for your feedback. I think we can agree on the point that
without any sync-capabilities the dbml thing is pretty useless. You
should hit the market with your templates :)
I've spend most of the day working on them, and they're done for 99%
:) Just a small glitch in 1:1 relations in the class files, and we're
good to go :)

We hope to release them tomorrow (wednesday) in beta

FB

--
------------------------------------------------------------------------
Lead developer of LLBLGen Pro, the productive O/R mapper for .NET
LLBLGen Pro website: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
Jun 27 '08 #8
thanks for your reply. is there a workaround? i mean, things change
in a development cycle, or not? what you've said seems to render the
whole database model thing useless.
I don't know whether this view will be popular, but my opinion is that
the current LINQ-to-SQL offering is good for rapid prototyping, and
for dipping a toe in the LINQ pond - R&D, etc. Maybe for "write once"
applets...

For production work on a moderate size system (i.e. where we
reasonably expect it to evolve over time), I'm waiting for Entity
Framework, which has better tooling, more flexibility (conceptual/
storage/mapping etc), and open provider support.

So yes; I agree with what you are saying (re LINQ-to-SQL), but I'm not
particularly concerned by it... if EF has the same gap, it would be a
bigger issue; I will try to find some time to fire up by beta machine
to investigate...
But I'm genuinely glad to see that Frans has spotted an opportunity to
innovate. Good luck to you, Frans! It'll certainly be yet another
selling point for LLBLGen.

Marc
Jun 27 '08 #9
hi frans,

i wish you the best of luck for llblgen. eventhough i won't profit from
it since i can't afford to buy a licence ;)

Kind regards. Matthias
--

Frans Bouma [C# MVP] wrote:
Matthias S. wrote:
Hi Frans,

thanks again for your feedback. I think we can agree on the point
that without any sync-capabilities the dbml thing is pretty
useless. You should hit the market with your templates :)

I've spend most of the day working on them, and they're done for 99%
:) Just a small glitch in 1:1 relations in the class files, and we're
good to go :)

We hope to release them tomorrow (wednesday) in beta

FB
Jun 27 '08 #10
Hi Marc,

We're currently working on a pretty large system. We are porting a
classic asp app (~200 pages plus a couple of windows services) piece by
piece to asp.net since we are a small dev-team and changes to the
system can be overseen, we'll go for the DBML thing since it seems to
fit our needs (except the missing sync functionality).

I'll certainly google for the Entity Framework you've mentioned ;)

Kind regards. Matthias
--

Marc Gravell wrote:
thanks for your reply. is there a workaround? i mean, things
change in a development cycle, or not? what you've said seems
to render the whole database model thing useless.

I don't know whether this view will be popular, but my opinion is that
the current LINQ-to-SQL offering is good for rapid prototyping, and
for dipping a toe in the LINQ pond - R&D, etc. Maybe for "write once"
applets...

For production work on a moderate size system (i.e. where we
reasonably expect it to evolve over time), I'm waiting for Entity
Framework, which has better tooling, more flexibility (conceptual/
storage/mapping etc), and open provider support.

So yes; I agree with what you are saying (re LINQ-to-SQL), but I'm not
particularly concerned by it... if EF has the same gap, it would be a
bigger issue; I will try to find some time to fire up by beta machine
to investigate...
But I'm genuinely glad to see that Frans has spotted an opportunity to
innovate. Good luck to you, Frans! It'll certainly be yet another
selling point for LLBLGen.

Marc
Jun 27 '08 #11
It'll be out in SP1... or at least, the ADO.NET team say "SP1" (.NET
3.5 SP1 and VS2008 SP 1), but Mike Taulty (at the MSDN roadshow on
Monday) officially couldn't call it SP1... but you get the idea...

http://blogs.msdn.com/adonet/
Jun 27 '08 #12
I finally got around to looking at my beta machine... EF does indeed
have an "Update Model from Database..." option, which looks at the
storage layer [EF's view of the database schema], and allows you to
add new items, remove deprecated items, and update existing. This
doesn't automatically update the conceptual layer [EF's class schema]
or the mapping layer [EF's tie between the two], but a quick glance at
the mapping panel quickly shows which storage properties don't have
corresponding conceptual properties. It is then trivial to add a
scalar property to the conceptual layer, and use the mapping layer to
tie it all together.

Of course, if you have a simple model and you just want to do a 1:1
mapping, you could just remove and re-add the table ;-p

In some simple tests (adding columns, etc) it seemed to work fine.

Marc
Jun 27 '08 #13
Matthias S. wrote:
hi frans,

i wish you the best of luck for llblgen. eventhough i won't profit
from it since i can't afford to buy a licence ;)
Thanks :)

Perhaps your employer is nice enough? ;)

FB

--
------------------------------------------------------------------------
Lead developer of LLBLGen Pro, the productive O/R mapper for .NET
LLBLGen Pro website: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
Jun 27 '08 #14

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Redd | last post by:
The following is a technical report on a data modeling project that was recently assigned to me by my professor. I post it so that anyone else who is studying databases and data modeling can have...
7
by: mittal.pradeep | last post by:
What is the better table design for a data collection application. 1. Vertical model (pk, attributeName, AttributeValue) 2. Custom columns (pk, custom1, custom2, custom3...custom50) Since the...
2
by: Elliot | last post by:
I'm having trouble structuring the data in an investment database. The basics are: * Investors invest in Deals * Investors can be either Individuals or Entities * Entities may or may not...
3
by: Simon Harvey | last post by:
Hi, In my application I get lots of different sorts of information from databases. As such, a lot of information is stored in DataSets and DataTable objects. Up until now, I have been passing...
5
by: Kevin C | last post by:
I was curious to know what some developers out in the industry are doing when it comes to exposing Data access logic, specifically persistence. This is assuming that your not using an O/R framework...
0
by: Marshal | last post by:
I've just had a chance to review LINQ, DLinq, and XLinq, (which I only heard about last week after the PDC). The various LINQs actually seem to live up to expectations - Using query semantics to...
7
by: Ronald S. Cook | last post by:
I've always been taught that stored procedures are better than writing SQL in client code for a number of reasons: - runs faster as is compiled and lives on the database server - is the more...
4
by: =?Utf-8?B?RXJpYyBGYWxza2Vu?= | last post by:
We’re storing our main entity in an insert only table which stores the history of past revisions, but we’re facing problems with storing this history as LINQ will only update the entity, and...
1
by: Andy B | last post by:
I have to learn how to do one or the other: linq to sql or ado.net entity framework. There will be overhead no matter what way I go since I don't know either one. Which one would be the best one to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.