What the hell does this mean. Is it because I have two different .DBML files that contain the same database table?
...
Error 343 The type 'mvc.Models.Bundle' already contains a definition for 'BundleIcon' C:\inetpub\wwwroot\Models\Assets1.designer.cs 3438 17 mvc
Error 344 The type 'mvc.Models.Bundle' already contains a definition fo...
Hello,
I'm trying to figure out the best way to handle a simple problem:
I have a simple LINQ join to two tables. I know how to return the type for one table, since it is the same as the generated dbml class. However, what if I want to return data from both tables- isn't there a way to return both and use their relationships? Do I rea...
Hi,
I am using LINQ2SQL in my current project. I have a quite a lot of tables ~30. When I create my DBML file I change some of the column names etc for readability.
Recently if I made a change to the table in the underlying Database I just deleted and re-added the table in the DBML file, but this is getting tedious. How can I mimic ...
I have a reference table with all sorts of controlled value lookup data for gender, address type, contact type, etc. Many tables have multiple foreign keys to this reference table
I also have many-to-many association tables that have two foreign keys to the same table. Unfortunately, when these tables are pulled into a Linq model and th...
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 add added this in the code behind view of the .dbml file. I switched back to the designer an...
Am I understanding correctly, and the database connection string for Linq to SQL is typically stored in the app.config file, in the connectionStrings section?
Are there other places it might be done, typically? Thanks!
...
I renamed one field in the database and added another. Then I removed the table from the DBML file, and re-added it. The I went to access the renamed property. The field shows up in intellisense, but will not compile, throwing a "no definition" error. I removed the project, reset the references, erased all the dlls, rebooted the machine,...
Hi,
I've been having a look at making changes to the partial classes generated from a DBML file. I was reading into using the sqlmetal.exe tool but it appears that you can't do much customisation of what it actually spits out.
I'm wanting to make changes to the file for serialization purposes, I'd like to add the Data Member Attribute...
Hi All,
I want to iterate through the tables in a dbml's xml. But i'm struggling to get to the Type elements. How would I do it using LINQ to SQL?
...
I'm planning to write an tool which would import dbml file and spit out an MDL file for migration purposes and such. To do this, I obviously have to read this dbml file into some kind of semantic model to do transformations.
I tried to use XmlMappingSource, but first it failed because it expects the XML namespace of a file to be http:/...
This may just be a yes or no type of question but here goes anyway...
From all (well most) of the examples that I've seen for using mvc, it appears that method for creating the dbml file is just drop the entire schema of the database into it and let it autogenerate all of the linq to sql goodness. It appears that you just need one of t...
Im planning to write a code generator to generate UI (forms, grids, etc.). Since i'm using Linq i'm planning to read dbml file for metadata extraction purposes. I wonder if there is some Api to read the Dbml object model (database, tables, columns, asociations).
I've opened SQLMetal.exe with Red Gate's .NET Reflector, it contains a nam...
I have a scenario where I define the XSD first, then generate the cs files from these XSD (using xsd.exe). I need to take this 2 steps furthur by generating the dbml from these and then calling CreateDatabase() on that dbml).
So the question is, does anyone have an idea how to create dbml from either an XSD or a cs file?
Thanks
Ash
...
I have three tables: Login, LoginRoles and Roles. Login joins to LoginRoles and LoginRoles joins to Roles. LoginRoles is a many-to-many table, and I want to constrain the columns as being unique TOGETHER.
LoginRoles: MemberId (int), RoleId(int)
This is similar to the aspnet_UsersInRoles table in the default membership database:
Tabl...
I'm creating an app that will have a fair amount of users. Everytime someone views a page or performs an activity I will be writing to a log. While I'm concerned about the performance of that in itself, my bigger concern is that I'm actually wanting to store that history in-session within the ASP.NET MVC application so that when they l...
In my database designs, I tend to have "clusters" of tables. These clusters will typically support one application or group of tightly-functionally-related applications. Often, these clusters also relate to each other through a relatively small number of foreign keys; this helps otherwise independent applications in the business integrat...
My SQL tables names are all plural - Events, Teams, Campuses, etc...
When I drag the tables in to the dbml, it creates an entity called "Campuse" which of course is incorrect. I manually rename that to Campus in the properties page, but it doesnt seem to update all of the auto generated code correctly. For example, the .designer.cs fil...
Hi, I have created a function that retrieves values based on datepart of a datefield from a stored procedure:
public List<spDB1GetIDsByTimeResult> GetIDsByTime(int timePart)
{
using (DB1DataContext db1= new DB1DataContext ())
{
List<spDB1GetIDsByTimeResult> query = db1.spDBGetIDsByTime(timePart).ToList()...
how to generate a DBML file using the ConnectionString in ASP.NET MVC
...
Hello, I have a problem with a double (TaxRate here), that do not have the same value when it pass through functions:
I first call a function
DataContext.UpdateCategory(theCategorie.Code, theCategorie.Description, theCategorie.TaxRate, theCategorie.TaxCode);
When I run the debugger the value of TaxRate is 19.6
Then when I put a stop...