Compiled query with DBLinq
Is it possible to create compiledQuery with DBLinq? ...
Is it possible to create compiledQuery with DBLinq? ...
Lets say we have an expression: var prices = from p in PriceDB.Prices where p.TypeID == 12 orderby p.PriceType.Title select p; Is it possible to modify the select list? I imagine it looking something like this: var newPriceList = prices.Select( p => p.ExchangeRate ); This may be an odd reques...
In Service Category table, ParentCategoryId is the ServiceCategoryId and that is the parent category, there can be nth level hierarchy of my categories, so I need to present this using Tree View Control. How can I do this? Thanks ...
Hello all. Still really struggling with this and appear to be going round in circles. I have the following code that is driving me nuts. It should populate a list of items to be used in an autocomplete text box: public string[] GetAutoComplete(string prefixText, int count) { string memberid = HttpContext.Current.Sessio...
Ok, I think this question is similar to this one: http://stackoverflow.com/questions/1704821/linq-to-sql-groupby-and-max-to-get-the-object-with-latest-date But I have a table which I want to return a lot of rows from. It's primary key is used as a foreign key in a second table. For each row returned from the first row, I also want to r...
I had a need for a method that could take a collection of strings, and replace all occurrences of a specific string with another. For example, if I have a List<string> that looks like this: List<string> strings = new List<string> { "a", "b", "delete", "c", "d", "delete" }; and I want to replace "delete" with "", I would use this LINQ...
How to convert DataTable having N rows into KeyValuePair<long,string>[] type having same N no of rows I want to return KeyValuePair<long,string>[] kind of value from a function that will convert DataTable into above type. ...
I am new to LINQ to XML in .net(C#, asp.net). I want to know more about Lambda expressions. I am using Lambada expression with the following query. count = FieldRoot.Element("USER").Element("MM") .Descendants("MMMS") .Where(a => a.Attribute("ID").Value == MID) .SelectMany(b => b.Descendants("ABC")).Co...
At first brush, OData seems like it will only appeal to "open" databases, and would never be used in envrionments where security is needed, especially with financial or government clients. Is this the correct perspective to have with the current version of OData/WCF? If not, can you share whatever I would need to change that perspectiv...
I have the following structure. public class ToolSettings { public string Extension { get; set; } public ObservableCollection<Tool> Tools { get; set; } } public class Tool { public string Name { get; set; } public string Command { get set; } } // Within app code public ObservableCollection<ToolSettings> settings { get; set; ...
Hi all, I've got a problem with Linq in VB.NET. I've created a .dbml file from my db, and everything looks good - relation "arrows" between tables are visible, etc. But when I want to use simple query (taken from 101 Linq Samples by MS): Dim q = From h In dc.Hours, w In h.WorkType I receive an error: Expression of type 'INTegrit...
I have a requirement in which in order to make an application extensible and reusable, I have to create a provision through which a user would be able to provide a business object structure (the fields, their types, etc.) through an XML file and using that structure the UI (i.e. the controls and the complete page), the data updation meth...
Hi, I have two tables TimeSheet and TimeRecord. TimeRecord has Foreign Key TimeSheetId of TimeSheet. The following time-logs are from TimeRecord, TimeSheet sample data: TimeSheetId, StudentId 187 , 10 196 , 11 195 , 12 TimeRecord sample data: TimeRecordId, TimeSheetId, TimeIn, TimeOut 1 , 187 , 8/17/2010 1:06:55 PM , ...
I have a parent-child table relationship. In a repository, I'm doing this: return (from p in _ctx.Parents .Include( "Children" ) select p).AsQueryable<Parent>(); Then in a filter, I want to filter the parent by a list of child ids: IQueryable<Parent> qry; // from above List<int> ids; // huge list (8500) var filtered = fr...
In .net 3.5 if I generate a linq to sql data context, it does some wonderful magic to pluralize names. In my code I need to pluralize some terms. Can I use whatever method Linq is using to generate my plurals? ...
tblUserRole Permission = (oCurrenUserPermission.GetPermission(Convert.ToString(Session["Navigation"]))); if (Permission.IsInsert == 1) { } public IQueryable GetPermission(string sPageName) { IQueryable query; #region MyRegion query = from r in this.Context.tblUserRoles join p in this.Context.tblPageInfos on...
I recently started work at a new shop that uses a table naming convention like the following: Users UserRoles UserUserRoles UserProfiles UserProfileLanguages The convention I've been using is: Users Roles UserRoleMaps Profiles Languages When my boss asked why I don't prefix my tables, I explained that a database diagram would exp...
I have two methods that look almost the same, except for the aggregate function used in the Linq query. For example: public IEnumerable<Item> DoStuff(IEnumerable<Item> someItems) { var items = someItems.GroupBy(i => i.Date).Select(p => new Item(p.Key, p.Sum(r => r.Value))); // ... } public IEnumerable<Item> DoOtherStuff(IEnumer...
Is there something similar with spring jdbctemplate for c# ? I am not seeking for jdbctemplate for c# but something that works very similar like jdbctemplate. I am familiar with ado net and linq to entities, but I like the concept of jdbctemplate. ...
Say that a page loads and the first thing I want to do is find the identity of the last record inserted into a table. I'm not going to be inserting any records or anything, i just want to come in blind and find the last id inserted, can it be done using LINQ? ...