472,959 Members | 1,678 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,959 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 3201
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...
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
2
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.