Using LINQ with IBM i
Has anyone been able to use LINQ with the IBM i? That is without having to write a custom provider? ...
Has anyone been able to use LINQ with the IBM i? That is without having to write a custom provider? ...
In my LINQ to SQL generated classes I have some classes containing EntitySets. Everything looks great until I need to modify the EntitySet (add, delete some relationships). I thought that it was going to work doing something like: User.Actions = newUserActions; //This is how I used it with NHibernate Then when I try to submit chang...
Hi folks, I have an audit table and I'm trying to use Linq to figure out how to grab all the people's more recent audit actions. I'm just not sure how. Sample Schema Audit Table (technically it's actually a view) AuditId UserName Action CreatedOn 1 Bob Action1 2000-01-01 2 Bob Action2 2000-01-...
Working through the WROX "Beginning ASP.NET MVC 1.0" book I've hit a strange 'error'. "Operator '==' cannot be applied to operands of type 'System.Guid' or 'int'". The line in questions is: (p => p.ID_Officers == id).Single(); The full code is below, and Officers is my table, ID_Officers is my ID field. (I imagine that I could of us...
I was looking at a dbml file in xml editor and noticed that some of the properties had a storage field and some did not. I also noticed that some had name, which I assuming is the name of the field in sql. If the property in the dbml file has a different name from the one in sql, it will add the member attribute. I don't understand wh...
I would love a solution to my current problem, but I would love EVEN MORE if I can understand what that error actually means. I have LINQ to SQL classes for two tables in my DB: Providers and Assignments. I added the following member to the Provider class: public IEnumerable<Assignment> Assignments { get { ...
What is the benefit of disposing of a LINQ to SQL DataContext? Or, is there a problem with not disposing of these DataContext objects? For instance, for easy coding, I might want to do something like... var list = from p in (new MyDataContext()).People where p.LastName.Contains("sommar") select p; In this case, I have new'd up an ins...
How can I see the SQL that is created from a LINQ to SQL query? The obvious answer is to open up the SQL profiler and look at it there. Is there a way in VS? Maybe there is a VS add-on like a visualizer that allows you to hover over the DataContext to view the SQL. ...
Hi, From what I gather, Linq to SQL doesn't actually execute any database commands (including the opening of database connections) until the SubmitChanges() method is called. If this is the case, I would like to increase the efficiency of a few methods. Is it possible for me to retrieve the ID of an object before inserting it? I'd rath...
I have an abstract EventBase class and some inherited event types, along with an Event class. Each event type has its own unique columns. In my data layer, I have a GetEvents method that simply does: from e in db.Events select new Event {...values...}; EventType is an enum which matches up to an EventTypes table I want GetEve...
I'm experimenting with LinqToSql and the MVP pattern and having trouble setting on a good design. I'm using Asp.net 3.5 (not MVC) Here is a example public interface IMyBusinessCardView { string Field1 { get; set; } string Field2 { get; set; } string Field15 { get; set; } } public class MyBusinessCardPresenter { private...
I'm using linq to SQL and MVC2 with data annotations and I'm having some problems on validation of some types. For example: [DisplayName("Geplande sessies")] [PositiefGeheelGetal(ErrorMessage = "Ongeldige ingave. Positief geheel getal verwacht")] public string Proj_GeplandeSessies { get; set; } This is an integer, and I'm validating ...
This is my first real-world LINQ-to-SQL query. I was wondering if I am making any large, obvious mistakes. I have a medium-large sized (2M+ records, adding 13k a day) table with data, dataTypeID, machineID, and dateStamp. I'd like to get the average, min, and max of data from all machines and of a specific dataType within a 4 hour peri...
I am just getting my feet wet with LINQ to SQL, and need some advice in implementing a simple scenario: I have a method ListTagCounts that is doing an aggregate query with LINQ To SQL. I was not sure of the return type to use, so used the ToList() method and created a class just for the return type in order to get it to compile. Schema...
Can someone pitch in their opinion about pros/cons between wrapping the DataContext in an using statement or not in LINQ-SQL in terms of factors as performance, memory usage, ease of coding, right thing to do etc. Update: In one particular application, I experienced that, without wrapping the DataContext in using block, the amount of me...
Using Linq I would like to return an object that contains customers and invoices they have. I understand returning a single type from a method: public IQueryable<customers> GetCustomers() { return from c in customers select c; } But I am having trouble figuring out multiple objects: public IQueryable<???> GetCustom...
This one's turning out to be a brain teaser for me. I almost hate to ask for help for fear I might miss out on the endless, sleepless night trying to cypher this mystery. JK I've got a C# project where I need to display a list of unique objects, but only the newest one based on the type of object. For discussion purposes, let's talk "fr...
I have a method that sets up my linq data context. Before it returns the DC it calls a stored proc that sets up the CONTEXT_INFO value to identify the current user. A trigger picks up any changes made and using this context data writes an audit record. I noticed that my context data was in the audit table blank so I wrote a simple unit...
When I had a Typed DataTable with information retrieved from a SQL Server with a table adapter, I'm able to insert temporary data into that DataTable which I just want to use on execution time, and I don't want it to be inserted into the database. First supose that for example I have a Database table like this: CREATE TABLE MyData ( ...
Hi, We are using linq-to-sql entities,and want to implement trimming for all string properties.One way is on submitchanges,using reflection trim all string properties.Is there any other way? thanks ...