Questions tagged [dbml]

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.

82 questions
1
vote
1 answer

in DBML, how to get child table with specific fields rather than all fields

We are using SQL Server and application is developed with DBML. Now due to the functionality of eager loading I am having an issue. I have a table A which have relationship with table B. (A -> B). Now when I try to load table A, it will get all…
Sachin
  • 2,152
  • 1
  • 21
  • 43
1
vote
1 answer

Linq to SQL property mapping to table

Let's say I have a database with 2 tables : User(Id, Name, PetId,...) and Pet(Id, Name, Color,...) and this class : class UserPet { // User table, generated in dbml public User User {get;} // Pet table, generated in dbml public Pet Pet…
Lou
  • 277
  • 1
  • 5
  • 15
1
vote
1 answer

Conflicts between databases

I have an automation project that I use for several similar sites. The databases of the sites are also similar beside the USERS table. In one database the table USERS has the column Fname, in the other one this column is not present. In the other…
1
vote
0 answers

Wanting to declare preBuild event command to change MSBuild to earlier version

So my issue is that I have a project with a DBML file that I am trying to Build/connect to a SQL 2000 database. We are currently using VS 2013 for the rest of our solution. My question is, is there a way to specify a Pre-build event to use VS 2008…
1
vote
1 answer

The SELECT permission was denied on the object '', database '', schema 'dbo'. using DBML

I have a site that was working fine until this morning. Now I am getting a 'The SELECT permission was denied on the object '', database '', schema 'dbo'. error. The thing is, the method is part of some DBML code and I can;t even find the…
rigamonk
  • 1,179
  • 2
  • 17
  • 45
1
vote
0 answers

Can't drag MySQL stored procedure onto dbml(Linq)

I want to use stored procedure of MySQL in my c# application. I have created a dbml file and connected successfully to MySQL database. I tried to select (drag and drop) the stored procedure but it is not getting done.However, I can drag and drop…
Sasu
  • 423
  • 1
  • 6
  • 21
1
vote
1 answer

Using inherited members from base class (moving repeatable code into base class)

I often use using (var context = new SomeDataContext(SomeDataContext.ConnectionString)) { ... } where abstract class DataContextBase: DataContext { ... } partial class SomeDataContext: DataContextBase { public const string DatabaseFile =…
Sinatr
  • 20,892
  • 15
  • 90
  • 319
1
vote
1 answer

Linq-to-SQL dbml DateTimeOffset column Auto Generated Value not getting correct timezone

I have a Linq-To-Sql dbml file setup with tables from my SQL database. Each table has it's own InsertDateUTC column which is of type DateTimeOffset. I have them set to Auto Generated Value = true so on insert they will be populated with the…
Bensonius
  • 1,501
  • 1
  • 15
  • 39
1
vote
1 answer

Can we use Generic Repository without using EF? Is it a good practise?

I have an application in which the person who designed the application had used a dbml to manage db classes. But we have another database that we often need to connect to and we've been using ado.net normally to connect to it as we cannot use same…
pulkitgulati
  • 41
  • 2
  • 9
1
vote
1 answer

Cannot Access .dbml Functions and Classes

I am creating a three tier website project. I am using Linq to sql class in my data-access-layer,all my sp's and tables are shown in DataAccessLayerCodeFile.designer.cs file,but when i make a instance of it in presentation layer,it successfully…
Muhammad Ali
  • 853
  • 1
  • 10
  • 18
1
vote
0 answers

C# DBML connection String fails while set

The connection string to my db is set in the Web.config for my project:
FiringSquadWitness
  • 666
  • 1
  • 10
  • 27
1
vote
0 answers

Is there a way to debug ExecuteMethodcall to retrieve the generated raw SQL call?

We're currently using a stored procedure supplied by a third party, which we are accessing via a locally generated dbml file. The third party has requested the SQL we are are generating for the call, but it is hidden inside the ExecuteMethodCall…
A-Bop
  • 68
  • 1
  • 11
1
vote
1 answer

Refreshing LinQ2SQL Model in Designer without losing all Properties

so I'm using LinQ2SQL quite heavily in my current application, and although I have most stuff in partial classes, some things have to be adjusted in the VS Designer (like Accessors for fields I wrap). Then, sometimes I like to name Fields…
Tigraine
  • 23,358
  • 11
  • 65
  • 110
1
vote
0 answers

Generate stored procedure declarations from dbml file

I have a .net project with Linq to SQL used in data access layer. The project is in development and all the stored procedures in db are added in dbml file. Unfortunately I lost database today, so in attempt to recreate database I managed to create…
MaxRecursion
  • 4,773
  • 12
  • 42
  • 76
1
vote
1 answer

Drag and drop stored procedure on .dbml file(VS 2010) and upon saving it creates another designer1.cs file

In my project, I have a data-access layer that contains .dbml file(named test.dbml) used to drag and drop stored procedures and tables. Two days ago when I drag and drop the stored procedure onto my test.dbml file. Upon saving it creates another…
Aamerallous
  • 133
  • 13