We use LINQ in our ASP .NET application to run database queries and commands. We have been having concurrency issues on updates to tables in which we update the value of a Date field. More specifically, if two users click a button at the exact same time and the code attempts to update a Date field in the database then the built-in optim...
After a long thought we found that the best approach for our needs would be to use multiple tables as if it was classes, so we have something like:
tblPerson (pk code)
tblWorker (pk codePerson)
tblPhone (pk code, fk codePerson)
tblAddress (pk code, fk codePerson)
it's almost like classes.
It was really necessary because many tables do...
Is there a quick command in VS2008 to update a DBML that I'm missing or do I have to dleete everything, re-add and then deal with renames and table mods manually? This seems a bit tedious.
...
I love Linq but it can rapidly clutter up the namespace with automatically generated types. Usually these automatically generated types are often irritatingly close to other objects leading to many hours of fun and laughter.
In the designer I notice that I can specify the table names, however I can not for the life of me see how to set ...
When dbml file is generated automatically by Visual Studio I get the exact field names as they appeared in the tables.
However, since VS does not provide refresh function for dbml, I run sqlmetal manually to re-create dbml file. It works fine with one exception -- sqlmetal "corrects" the names
ses_Id -> Ses_Id
aga_Id -> Aga_Id
and so...
I have this 2 tables
table name: Person with Columns:PersonID, Name
table name: VisitInfo with Columns: VisitPersonID , CoordinatorPersonID
both columns have a foreign key to person table
When i generate the code i get a VisitInfo class with the properties:
Person
CoordinatorPerson
But what i want is a VisitInfoClass with the ...
i am having a small problem here.
The table which dbml (LinqToSql designer) is using has columns (Foreign keys), for which it generates two objectsfor the coressponding Blogs table (1:1 association) in DB lmost same,
like
Table Authors: AuthorID INT, Name varchar(20), BlogID INT
And
TABLE BLOG: BlogID INT, Name varchar(MAX)
Bl...
This is a similar problem to this question
When I deployed my dev app to the prod server I was getting an error:
System.Data.SqlClient.SqlException: Invalid object name 'dbo.Login'.
The table attribute on the linq mapping looks like [Table(Name="dbo.Login")]
When I loaded the prod db schema into the vs2008 server explorer and refresh...
My original dbml file had objects which had data connection to other server/db. As my db is changed to different server and i want to update my spproc when i delete the spproc and drag the new one dbml.designer.cs is deleted. I am using VS 2008 SP1. I can't regenerate all my dbmls as they have lots of tables, sps etc.. Inserting the usin...
I have a very pretty DBML diagram that I would like to preserve in our Design Documents. How do I get an image showing all of the tables in one go?
I found http://stackoverflow.com/questions/1686767/how-to-export-visual-studio-2010-uml-modeling-diagrams but the slightly elegant solution of copying all the items and pasting them into an ...
I want to add the new tables to dbml file dynamically from another database
Thank you
...
I am working on a web application using ASP.NET 3.5. The application has hundreds of tables. I was told in a seminar that I should use one .DBML file for the entire application instead of using multiple .DBML files (there was also a post in stackoverflow that said the same thing). Given that I have so many tables does using one .DBML f...
If I had two tables such as this:
Profile Table
-------------
PK ProfileID int
FK AddressPrimaryID int
FK AddressSecondaryID int
Address Table
-------------
PK AddressID int
Address nvarchar
City nvarchar
State nvarchar
Zip nvarchar
Notice, the profile has a two relationships to the same table, the address table. When I create my li...
Linq to SQL, in the dbml designer (or otherwise)
I have 3 tables:
Orders, Deliveries and EmailTemplates.
Orders have many Deliveries, and Orders and Deliveries have a status (int) field.
EmailTemplates have a status they apply to and a bool IsForDeliveries field.
I have Linq to sql associations for Order->EmailTemplate on order.st...
This is not an issue with a few tables, but when I have a ton of tables on my dbml diagram, I have to pan and zoom to find the table I am looking for. Is there a way to search the dbml diagram so it automatically goes to the table I searched for?
...
Hello, I'm working with a dbml for my tables in one application, when I created the dbml it was working well, but when I added a new table in the dbml it does not update and now it does not work. Could you help me?
...
I have a DBML file with a very large data model. Whenever I need to add a relationship between to tables I have to select the other table from a combo box which appears to be in in almost random order. Is there a reason these dropdowns aren't in alphabetical order, or is there a way to put them in some kind of order?
...
In my DBML file I have mapped some tables and stored procedures, and the stored procedures return type is ISingleResult . T is some mapped table. But I want to take the data into my own created entities rather than LINQ to SQL created entites. The entites created by me are also the same as the mapped table entities and their use lies whe...
Since I switched to VS2010, several times a day I get a compilation error in my dbml file:
DBML1005: Mapping between DbType 'bigint' and Type
'MyNamespace.SecurityToken' in Column 'SecurityToken' of Type
'Employee' is not supported
When I restart VS2010 the error disappears. I have no problems running my application using this dbml fi...
I am having occasional trouble with my C# dbml where it starts not linking properly.
I do not know how to replicate the exact cause of the problem, it was working perfectly until I changed a database table and then deleted the table and readded it with the new schema.
The error message I get is "The type or namespace name 'tbl' could no...