Limit rows in table per page
I would like to be able to limit the number of rows that can be in table on View page (I am using ASP.NET MVC), and if there are more rows, it goes to the next page. ...
I would like to be able to limit the number of rows that can be in table on View page (I am using ASP.NET MVC), and if there are more rows, it goes to the next page. ...
Hi, Apologies if this has been posted elsewhere but I can't seem to find any info regarding this. I'm trying to load an object using the LinqtoSql data context. I have a Page and Template table. There is a relation between the two: Page.TemplateId to Template.TemplateID The data context autocreated the Page and Template classes. My ...
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...
I want to relace a value retrieved from a L2E projection to an expanded string. The table contains a column called Status which can have a value "0" or "1" and in my L2E I have var trans = from t in db.Donation select new DonationBO() { Status = t.Status }; What I want is to return e...
This is the scenario: I have a huge code-base written in .NET 2.0...and sometime back the migration happened to .NET 3.5. This code-base is both refactored and enhanced as an ongoing maintenance project. I am looking for patterns to identify in code base which are good candidates for LINQ to Objects. I need pointers for comprehensive a...
I'm just getting my feet wet with Linq and IEnumerable, and I'm needing help in trying to determine if my objects contain matches for a card game. I think if I get the first one figured out, the other match checking I need to do will fall in place. public class Card { pubic int Value { get; set; } public Card(int value) { ...
I've got a T-SQL query similar to this: SELECT r_id, r_name, count(*) FROM RoomBindings GROUP BY r_id, r_name I would like to do the same using LINQ. So far I got here: var rooms = from roomBinding in DALManager.Context.RoomBindings group roomBinding by roomBinding.R_ID into g select ne...
When I try the following I get an error : Cannot use subqueries on a criteria without a projection. Can anyone tell me how I would create the added expression with the property name to the IQueryable: repository.Query (the type is defined at the class level). private void CheckConstraints(T model, ModelStateDictionary modelState)...
I have a intranet hosted web application where the user will upload a text file with space delimited data in 5 columns. I don't wish to save the file so I wanted to just use it in memory. I tried many different examples off the web and none worked. Finally a co-worker showed me how to do this. Here is the code and I'm wondering if there ...
the following member expression type can sometimes be NUllable, I m checking that , however I need to convert it to a non nullable type , MemberExpression member = Expression.Property(param, something); var membertype = member.Type; if (membertype.IsGenericType && membertype.GetGenericTypeDefinition() == typeof(Nullable<>)) { // conv...
Dim dataContext As New ACSLostFoundEntities() Dim query = From s In dataContext.FosterForms() _ Join c In dataContext.Fosters() _ On c.License Equals s.License _ Where s.Deleted = "False" _ Select New With {.License = s.License, _ .LastName = s.LastName, _ ...
Greetings, I am having some issues with using a bool operation within a Where clause extension method of an IQueryable object obtained using Linq to Entities. The first example is showing what does work using Bool1 as the operation I need to move to a where clause extension method. The second example is what doesn't work after the chan...
Is it possible to do this in LINQ to SQL in a single command? /* Hello, everyone */ Insert into Messages ( Message, ContactID ) Select Message='Hello', ContactID=ContactID From Contacts (I know I could iterate through Contacts, InsertOnSubmit many times, and SubmitChanges at the end; but this generates one Insert comman...
My xml looks like: <root> <blah1>some text</blah1> <someother>blah aasdf</someother> </root> I want to convert this to a dictionary So I can do: myDict["blah1"] and it returns the text 'some text' So far I have: Dictionary<string,string> myDict = (from elem in myXmlDoc.Element("Root").Elements() ...
Wondering if there is a fast way, maybe with linq?, to convert a Dictionary into a XML document. And a way to convert the xml back to a dictionary. XML can look like: <root> <key>value</key> <key2>value</key2> </root> ...
Hi I'm a complete begginer with Linq. And I woild like to know, if it is possible to make a query where for a given Class1.Code I get matching Class2.Value. class Class1() { public string Code; ... } class Class2() { public double Value; ... } SortedList<Class1, Class2> Thank you for your help. ...
I am very new to Ninject and am trying Ninject 2 with MVC and Linq. I have a SqlProductRepository class and all I want to know is what's the best way of passing the connectionstring in the constructor if I am injecting the Repository object in the controller. public class SqlProductRepository:IProductRepository { private Table<Pro...
I have a Users table, Events table, and a mapping of UserEvents. In some parts of my code, I just need user-based stuff. In other parts, I need all of this information. (Especially: given a user, what are the details of each event they are subscribed to?) If I have one repository just for users and another for users + events + userevent...
I have tried some ways to use LINQ dynamic queries - LINQKit and LINQ Dynamic Query Library. I do not like the second because it some way kills the LINQ idea - to be able to check queries at compile time. And with LINQKit I did not find a good example for my scenario. Also I do not like excessive using of reflection. My scenario is the...
I have 3 comma separated strings FirstName, MiddleInitial, LastName I have a class NameDetails: public class NameDetails { public string FirstName { get; set; } public string MiddleInitial { get; set; } public string LastName { get; set; } } I have the values for strings as: FirstName ="John1, John2, John3" MiddleInitial...