For questions specifically about the linq-to-sql dbml file (structure or location) generated by SqlMetal or Visual Studio. Questions about linq-to-sql should be tagged by the [linq-to-sql] tag.
Questions tagged [dbml]
82 questions
10
votes
1 answer
Is there a way to find a table in a DBML file in Visual Studio 2008?
This ones been bugging me for ages.
Back in the olden days when we hunted our own food and used DataSets, you could snap to a particular table in a DataSet by selecting what you want from a drop down list at the top.
If I have a big ol' Linq2Sql…

joshcomley
- 28,099
- 24
- 107
- 147
9
votes
2 answers
DBML changes & source control
I'm having some issues with the DBML. Every time the team needs to synchronize changes into SVN, the DBML is changed which generates lots of conflicts. This seems to be related to some rearrangement in the dbml editor, because most of the…

Gustavo
- 359
- 2
- 5
8
votes
1 answer
How do I generate a dbml file?
How do I generate a dbml file?
In a Visual Studio file, A project contains a DBML file that, when opened, shows a very cool representation graphical of a database and all the interconnections between the tables.
I want that for another project for…

xarzu
- 8,657
- 40
- 108
- 160
5
votes
2 answers
Visual Studio and LINQ: placing the DBML file in separate directory in the project
My strategy was to keep the project's layout clean. Given that this is a datalayer project, and I'll have a class file for each concerned entity, I thought I would put the .dbml into its own directory. It turns out that locating your .dbml file…

p.campbell
- 98,673
- 67
- 256
- 322
5
votes
1 answer
C# XML documentation of Linq to SQL
How to document the classes & properties & functions that are generated automatically using LINQ to SQL DBML?
I managed to provide documentation to the datacontext class by defining the same partial class in another file with so it won't…

Katia
- 679
- 2
- 15
- 42
5
votes
2 answers
Autogeneration of a DataContext designer file when using SqlMetal and Visual Studio
I am using SqlMetal to general my DataContext.dbml class for my ASP.net application using LinqToSql. When I initially created the DataContext.dbml file, Visual Studio used this to create a related DataContext.designer.cs file. This designer file…

Yaakov Ellis
- 40,752
- 27
- 129
- 174
4
votes
2 answers
How do I use sqlmetal to generate an internal (not public) data context
I'd like to use sqlmetal to generate dbml data contexts for my project, but the data context and all classes created are marked as public. As this is supposed to be an API layer I'd like to instead mark many of these classes or at least the context…

Mykroft
- 13,077
- 13
- 44
- 72
3
votes
1 answer
Visual Studio 2022 hangs with "Opening the file..." message
When I Trying to open dbml files, Visual Studio 2022 hangs with "Opening the file..." message
it's not happen when I open any other files
I tryed to solve this problem by:
-Uninstall Devexpress
-Uninstall Visual studio 2022
and reinstall both of…

Khaledalmolaa
- 75
- 2
- 10
3
votes
1 answer
linq-to-sql won't serialize references
So I have a couple of tables in a linq-to-sql dbml file:
I have set up a WCF REST get endpoint to user. I cannot get it to pass back a JSON structured like this:
{
ID: '123',
Username: 'fdsaf',
...
Role:
{
ID: '123',
…

Matthew James Davis
- 12,134
- 7
- 61
- 90
2
votes
2 answers
Editing Autogenerated DMBL file for WCF Service
In our project we have a standard auto-generated designer.cs file, linked to a DBML file, that contains all our object classes that map onto our database tables.
We want to pass these objects directly through a WCF Service and so they need…

Robin Weston
- 873
- 2
- 10
- 24
2
votes
1 answer
How to swallow ... exception with specific reason
In this method
public static void Detach()
{
try
{
using (var master = new DataContext(@"Data Source=(LocalDB)\MSSQLLocalDB;Initial Catalog=master;Integrated Security=True"))
{
…

Sinatr
- 20,892
- 15
- 90
- 319
2
votes
0 answers
VS2010 DBML Designer renames associations
We manage the structure of our database using a SQL Server Data Tools project (.sqlproj), creating new objects in Visual Studio and publishing them to the SQL Server instances (directly or by generating a publish script).
SSDT automatically names…

Emyr
- 2,351
- 18
- 38
2
votes
1 answer
How to undo Visual Studio's obsession with recreating the .designer.cs file of my DBML?
This is driving me nuts. I think it is because of some connection string mismatching across the app (using MVC) but Visual Studio constantly takes my .designer.cs file and recreates it adding a '1' at the end (or 2 if it already did this before…

MetaGuru
- 42,847
- 67
- 188
- 294
2
votes
1 answer
DBML removes .Name Attributes?
I have been renaming our model names in our codebase using resharper. I had made some changes some of the modals names within the .dbml file. I noticed that I need to add the name attribute to the propery in order for the sql to work correctly. I…

user154366
- 581
- 2
- 5
- 19
1
vote
1 answer
What causes "O/R Designer validation failed" after minor changes to a .dbml file using Designer?
I added some columns to a table using SQL Server Management Studio, and then wanted to reference them in my project in Visual Studio 2010, where it is loaded using Entity Frameworks, which seems not to have a handy feature for simply importing…

Dronz
- 1,970
- 4
- 27
- 50