I've created a table in Microsoft Sql CE that I'm using to hold some data. I've generated an ORM via SqlMetal and I've pulled the datasource into my WPF project.
I want to create a simple WPF form that can be used to edit a record in the table via the ORM-generated classes. I want this form to support typical OK/Cancel semantics. I'v...
In past I use dynamic sql and datatable to get data from database.
Such as :
Public shared function GetUsersByUsername(byval username as string) as datatable
dim strSQL as string="select * from
Users where Username= " & username
return dbClass.datatable(strSQL)
end function
And I could use this data such this:
Dim Email as str...
I was wondering what people thought about the decision to support Entity Framework over LINQ-to-SQL? I have an application I'm developing originally in LINQ-to-SQL. I found it the perfect solution for our application.
While attempting to port to Entity Framework I was surprised how rough it was. IMHO, not even close to being ready f...
I have a couple of tables in my database, one called Task, and another called User. The Task table has two columns CreatedBy and ModifiedBy that map to the UserId column in the User table.
I want to add the User table to the dbml file and add the associations. I notice now that when I look at class I have two properties one called Use...
I have the same problem as this guy:
I have a table that has references my tblstaff table twice for two different people. Now that I have added this second reference neither of them work.
What is up w/ that?
...
I have the following Transact-Sql that I am trying to convert to LINQ ... and struggling.
SELECT * FROM Project
WHERE Project.ProjectId IN (SELECT ProjectId FROM ProjectMember Where MemberId = 'a45bd16d-9be0-421b-b5bf-143d334c8155')
Any help would be greatly appreciated ... I would like to do it with Lambda expressions, if possible....
I've got two tables that need to be joined via LINQ, but they live in different databases. Right now I'm returning the results of one table, then looping through and retrieving the results of the other, which as you can guess isn't terribly efficient. Is there any way to get them into a single LINQ statement? Is there any other way to co...
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 itself as internal. Is there a way to do this in sqlmetal or some other tool without havin...
i know its a new thing , more powerful and a lot more options added to it,
but is linq2sql is part of the new EF ?
if not , what is the main different between the two frameworks?
...
All,
So I've got all my select queries in LINQ-to-SQL converted to using CompiledQueries to speed things up. Works great so far for select statements, but I haven't been able to figure out how to pre-compile insert, update, or delete statements.
Granted, when you're inserting, deleting or updating in LINQ-to-SQL, you have to use the o...
I am trying to creating an optional association between a couple of tables. I have one table called Invoice. The Invoice table has a FK reference to the Customer table through the CustomerId field. The Invoice table also has a not enforced FK reference to the Project able through the ProjectId field.
Is there anyway to set up my Linq...
Please if you have used NHibernate and Entity Frameworks, please contrast your experiences.
...
I'm trying to create a LINQ to SQL class that represents the "latest" version of itself.
Right now, the table that this entity represents has a single auto-incrementing ID, and I was thinking that I would add a version number to the primary key. I've never done anything like this, so I'm not sure how to proceed. I would like to be able ...
I have LINQ statement that looks like this:
return ( from c in customers select new ClientEntity() { Name = c.Name, ... });
I'd like to be able to abstract out the select into its own method so that I can have different "mapping" option. What does my method need to return?
In essence, I'd like my LINQ query to look like this:
return...
I'm having an issue with the following code:
private void DataPortal_Fetch(TaskCriteria criteria)
{
using (var ctx = ContextManager<Gimli.Data.GimliDataContext>
.GetManager(Database.ApplicationConnection, false))
{
this.RaiseListChangedEvents = false;
this.IsReadOnly = ...
Let's say I have two tables:
Report
Comment
And assuming I have a database context:
var reports = db.Reports();
How can I make sure all Comments for each report are loaded as well?
At this point I want to disconnect from the database but still
have access to the comments. (For example:)
reports[0].Comments[0].Subject
...
I'm trying to determine if any changes were made to a particular entity object. Essentially, I want to know if SubmitChanges() will actually change anything. I would prefer to be able to determine this after SubmitChanges() has been called, but it doesn't really matter.
Anyone know how I would do this?
...
I have some tables that represent various types. They usually just consist of an ID (int), and a name. Ideally I would have this in an enum. Is there a way to map a table like this onto an enum?
EDIT: How would I handle it if there were extra fields other than an ID and Name?
...
Using Linq to SQL:
if(!parentlist.childlist.Contains(row1))
parentlist.childlist.Add(row1);
else
How do I update the required childlist row with row1? Each row of the child list has a unique id.
parentlist implements IEnumerable and childlist is IList.
...
Hi,
What I wanna learn is if we put every table into one LinqToSQL file, do we lose performance ? Is it better to put each table in different LinqToSQL Files or it's the same thing with putting in single one.
I hope I could explain my question.
Thanks and Regards...
...