Questions tagged [or-designer]
10 questions
5
votes
3 answers
How do you use Linq to connect tables in different databases?
I'm a bit of a Linq newbie, and I couldn't find any documentation to help me with what seems to be a pretty trivial problem - so your help will be much appreciated!
I have a table Table1 in database DB1, which has a "pseudo" foreign key Table2ID to…

Shaul Behr
- 36,951
- 69
- 249
- 387
2
votes
5 answers
My O/R Designer keeps deleting the designer.cs file!
I have a weird problem that sometimes when I make a change to a Linq object using the O/R designer (usually by adding a field that I've added in the DB), when I save the project, the designer.cs file gets deleted!
Fortunately I have my source…

Shaul Behr
- 36,951
- 69
- 249
- 387
2
votes
2 answers
LinqToSQL and auditing changed fields
Here's another one of these LinqToSQL questions where I'm sure I must have missed the boat somewhere, because the behavior of the O/R Designer is very puzzling to me...
I have a base class for my LinqToSQL tables, which I called LinqedTable. I've…

Shaul Behr
- 36,951
- 69
- 249
- 387
2
votes
2 answers
How do you implicitly convert a string value to an enumeration using LinqToSql?
I asked a previous question about mapping an enumerated value on a table using LinqToSql and the answer was to use the O/R Designer to set the type to global::MyNamespace.TMyEnum.
That works OK if your enumeration is based on an integer. But what…

Shaul Behr
- 36,951
- 69
- 249
- 387
1
vote
1 answer
LINQ to SQL Classes implementing an interface
I'm designing the data model for an app with the LINQ to SQL (O/R) designer and wonder: is it possible to have (many) classes implement an interface or base class and store the implemented fields' values in the DB?
Most if not all of my classes need…

Mels
- 476
- 2
- 17
1
vote
3 answers
Using reflection to address a Linqed property
I'm trying to writing a generic method that will load a record of a specific type, with a specific ID. Here's one way that works:
public abstract class LinqedTable where T : LinqableTable {
public static T Get(long ID) {
…

Shaul Behr
- 36,951
- 69
- 249
- 387
1
vote
2 answers
How to sort DBML objects alphabetically?
I've got a DBML file in my project with all my LinqToSql objects. Initially I imported them from the DB, and all was well. Now as my DB has been growing, I've been adding the new tables to the diagram in the O/R Designer, but they always get…

Shaul Behr
- 36,951
- 69
- 249
- 387
1
vote
1 answer
How can I access properties of related records? (O/R designer generated entities)
I'm new to Linq-SQL and have used the O/R designer to generate my data classes.
My main data table has a couple of 1:M (child-parent) relationships and these associations have been set up in the designer.
What I want to be able to do is something…

Tom Wright
- 11,278
- 15
- 74
- 148
1
vote
3 answers
How to relate Linq-To-Sql objects that are on different dbml diagrams?
I have two different dbml diagrams reflecting my Linq-To-SQL classes. (This is necessary, because they appear in different projects.) One of the objects in the one diagram needs an association with an object in the other diagram.
How do I do it?

Shaul Behr
- 36,951
- 69
- 249
- 387
0
votes
1 answer
How to add additional assembly references to Linq2SQL DBML file?
I have an DBML file in which I am using the IPAddress class (System.Net) to map a field in the database. Yet, I didnt find a way to have the DBML designer remember that it should add a "using System.Net" to the generated code.
Adding it manually…

Hefaistos68
- 381
- 3
- 9