I have a dbml file that was autogenerated. I want to, in code (VB.Net) get the Association values for one of the properties. How is this accomplished?
Basically, in my vb.Net code I'd like to somehow know (in the following example) the LookupDocumentStatus.IsForeignKey and the LookupDocumentStatus.ThisKey value.
Is there an easy way to...
Hi,
I have a Client/Server application, where the Client and Server have some common tables (which are kept in synchronisation as part of the application).
We currently store these tables (i.e. FileDetails) in a Shared.dbml file. Until now, any stored proc that returns a result of set of FileDetails, has been placed in the Shared.dbml ...
When I drag a particular stored procedure into the VS 2008 dbml designer, it shows up with Return Type set to "none", and it's read only so I can't change it. The designer code shows it as returning an int, and if I change that manually, it just gets undone on the next build.
But with another (nearly identical) stored procedure, I can...
For example, I alter a column in a table to be not null from null.
I need to then delete and readd the table. That part is pretty clear.
What about views, functions, and stored procedures that access the table, especially that column in the table?
I've tried running diffs against the files generated by SQLMetal with some limited succ...
Hi, can I force the DBML designer to use my custom types instead of the Auto-generated Types?
I can edit the database.designer.cs, but these changes will be lost when I modify the tables.
If not, how can I easily "convert" from the auto-generated type to my custom type in Linq?
...
Hello,
My dev machine has SQL Server 2005 on it and that is how I make my DBML file and define the tables in there and then make a WCF Service. When i go to host the WCF service, the server has SQL Server 2000, it finds the connection string fine but not the table im pointing it to. Is there a way to tell through the web.config file whic...
In my partial class which defines a function which returns the type of IMultipleResults to bring back multiple result shapes from a stored procedure using the classes defined in my *.dbml file, for some reason the [ResultType(typeof(MyType))] isn't working. The MyType is saying that it cannot be found. The function is in the .cs file o...
If I inherit one DBML file from another DBML file, is it possible to visually create associations to the data classes from inherited DBML?
...
I'm creating a .dbml file from a database. My "property" table has foreign keys to the "county" table and to a "propertysource" table.
When code is generated, Property.Source is defined as a PropertySource type, but Property.County is defined as an int, instead of a County type.
I'm afraid I don't have the experience with LINQ to SQL t...
Greetings All,
We have two databases, DEV and STAGING. They are for the most part identical. I have an app settings tag in the Web.Config call it "mode", and two connectionstring entries.
If mode=DEV I want to use ConnectionString 1 otherwise use ConnectionString 2. This works fine in some parts of the app, but the dbml doesn't seem to ...
I've been working on a project where I have been using LinqToSQL that involved a lot of tables. All of these where mapped in one .dbml file (i.e. only one DataContext). I did this on the pretense that (currently) you cant join across multiple data contexts. For example...
DB1DataContext db1 = new DB1DataContext();
DB2DataContext db2 = n...
Hi does someone know a quick way to find a class in large dbml files. We have a large data model and it takes a good 2-3 minutes to scroll and locate the required class. Zooming out makes it quite hard to see.
There has to be a better way than manually looking around
...
I am abit curious about dbml.... Should I create one dbml file for one database or separated into different parts e.g. User dbml (only tables relate to users) etc? When I do this I will have abit of problems. Assume the User dbml has a User table and if the Order dbml has a User table as well, this won't be allowed if the entity namespac...
I have a rather large DBML file and recently discovered that Visual Studio's MSLinqToSQLGenerator is generating different output than:
SqlMetal.exe All.dbml /code:All.designer.vb /namespace:LINQ2FSE /pluralize /provider:SQL2005
It seems to have dropped an arbitrary (and I think relatively small) set of associations from the generated ...
I have some views that I'd like to relate together in my Linq2Sql DBML file.
I've right clicked, selected "Add association" and manually created the associations from children to parents, for example:
Customer.TypeId -> CustomerTypes.Id
But I cannot do this in my code:
from c in Customers select c.Type.Name
Any clues? If the relat...
I am trying to serialize some Linq objects using this code.
private byte[] GetSerializedObj(object o)
{
try
{
DataContractSerializer formatter = new DataContractSerializer(o.GetType());
MemoryStream memStream = new MemoryStream();
formatter.WriteObject(memStream, o);
return memStream.ToArray();
...
After dragging two tables in from one database, I switch to another and drag a table in. Now I get a message if I want to replace the connection string with the new one. I want tables from multiple databases in one DBML. Is this possible?
...
One of the fields in a table in my database stores string values delimited by '|'. Of course, when I generated a Linq data model from the table using the VS designer, a string property has been created for the mentioned field. I want to override that property so as to expose the stored values as a more convenient string array (splitting ...
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?
...