Skip to content

LINQ

LINQ (all flavours)

This category can be followed from the open social web via the handle linq-e04cf296@forum.codeproject.com

783 Topics 2.8k Posts
  • deferred loading in LINQ

    csharp database asp-net linq question
    2
    0 Votes
    2 Posts
    0 Views
    A
    Member 3981366 wrote: I want to know -- accrding to defereed loading the queries should be executed only when it's requested in for each loop.and in immediate load we get all data at once. Yes, you are absolutely correct.Just to be precise, query is executed once and result is then iterated in the foreach loop. Member 3981366 wrote: but doesn't query executes on var result =..stmnt.? No it does not. You have yourself demonstrated it in your examples. To make things more clear, read the "Defered Query Evaluation" section from here[^]
  • Merging two tables columns in third table in VB.net Linq

    csharp linq question
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • Dotnet Nuke and Asp.Net 3.5

    csharp help asp-net tutorial
    2
    0 Votes
    2 Posts
    0 Views
    A
    Did you see this Link[^] ?
  • LINQ and server side execution

    database csharp sharepoint linq sysadmin
    2
    0 Votes
    2 Posts
    0 Views
    A
    I am assuming you are referring to Linq to SQL. Member 3981366 wrote: server via server side code You mean database server? Yes Member 3981366 wrote: doesn't it create extra load on server What do you mean by "extra load" ? You need data so you will query the database, isnt it ? Member 3981366 wrote: Is it true that we can run db queries or sp's gives more performance over LINQ queries I do not understand this statement.The LINQ query is converted to a db query and then it is run on the database. So why do you feel it is different ? Well, there are some performance considerations but there are suggestions to overcome them too. The LINQ query will be converted to an database query and run on the databse returning you the result. It provides you with a strongly typed query language. See here Lind to SQL[^]
  • 0 Votes
    12 Posts
    0 Views
    N
    the fault is result.Timestamp -> has to be g... then it works
  • A LINQ query issue ?

    csharp database linq xml help
    16
    0 Votes
    16 Posts
    0 Views
    A
    Hey thats cool. But, does the query return the 3 rows ? I guess it would return just 1 row for the criteria matching rows.
  • Peer Learning Topic Suggestions

    csharp learning workspace
    2
    0 Votes
    2 Posts
    1 Views
    A
    what exactly you want from us. there are millions of topics in universe... Choose the best that suits your work environment. :-D :-D Abhishek Sur My Latest Articles Basics on LINQ and Lambda Expressions Create .NET Templates
  • ASP.NET MVC web App

    asp-net csharp dotnet architecture tutorial
    3
    0 Votes
    3 Posts
    0 Views
    K
    Thanks.
  • Detecting sequences of items with same attribute

    algorithms question
    2
    0 Votes
    2 Posts
    0 Views
    A
    Don Rolando wrote: everal instances So you have a list ? I just wrote up something dumb but I am sure you can do it in a more cleaner and scalable way, List data = new List{ new myObject{position = 1, valid = true}, new myObject{position = 2, valid = true}, new myObject{position = 3, valid = true}, new myObject{position = 4, valid = true}, new myObject{position = 5, valid = false}, new myObject{position = 6, valid = true} }; var query = (from d in data where data.Any(d2 => (d2.position == (d.position + 1)) && (d2.valid == true) ) && data.Any(d3 => (d3.position == (d.position + 2)) && (d3.valid == true) ) select new { id1 = d.position, id2 = d2.position + 1, id3 = d.position + 2 } ); foreach (var op in query) { Console.WriteLine( "id1 ={0}, id2={1}, id2={2}", op.id1, op.id2, op.id3 ); }
  • Extended Methods

    csharp question
    2
    0 Votes
    2 Posts
    0 Views
    A
    From here[^], "Extension methods are a special kind of static method, but they are called as if they were instance methods on the extended type." Member 3981366 wrote: returning strongly typed variables or collections Sorry, I don't understand what you mean. Member 3981366 wrote: do we need to add "this" keyword for creating extended method Yes, if you want it to be used as an Extension method i.e. the compiler automatically glueing the code for linking the static extension method to the instance object Member 3981366 wrote: every static method in static class can be called extension method No, since you cannnot use static methods with instance object. There lies the major inclination of extension methods.
  • How build query in Linq

    csharp database linq
    2
    0 Votes
    2 Posts
    0 Views
    M
    You should write a something like this : alfhv wrote: "select * from t_Rates WHERE (t_Rates.id_Contract = " + ddContract.SelectedValue + ") AND (t_Rates.id_Service = " + ddService.SelectedValue + ") AND (" + strOr +")"; var query = from q in t_Rates where t_Rates.id_Contract == ddContract.SelectedValue && t_Rates.id_Service == ddService.SelectedValue selecr q
  • Dynamic Select on columns?

    csharp question database linq data-structures
    4
    0 Votes
    4 Posts
    0 Views
    A
    Read Scott's post, Downloading the LINQ Dynamic Query Library section. This is a wrapper API. You will have to download the file(it's name is DynamicLibrary.cs present in the sample's folder), add it to your project and then add the namespace in your class. After doing this everything should work. Edit: As I said, the blog mentions wrappers. You can see the actual implementation in the class file or here[^] modified on Friday, February 27, 2009 11:22 PM
  • Linq query to DataTable

    question csharp database linq
    4
    0 Votes
    4 Posts
    0 Views
    A
    System.Reflection.PropertyInfo ?? Try the second method, it looks cleaner than the reflection one. You might have to take a look at the GetCommand[^] method. I presume the samples posted work ?
  • what is LINQ

    csharp linq tutorial question
    3
    0 Votes
    3 Posts
    0 Views
    M
    I've used LINQ to XML in this project : http://www.codeproject.com/KB/cs/KingMark.aspx[^] and LINQ to SQL : http://www.codeproject.com/KB/WPF/PersianDiaryWPF.aspx[^]
  • New to linq.

    csharp linq com
    3
    0 Votes
    3 Posts
    0 Views
    M
    Hi Look these links : http://weblogs.asp.net/scottgu/archive/2007/05/19/using-linq-to-sql-part-1.aspx[^] http://mds-soft.persianblog.ir/post/68/[^]
  • LINQ Scenario

    csharp database linq question
    2
    0 Votes
    2 Posts
    1 Views
    E
    Using LINQ-to-DataSet is a lot easier than using GetChildRows, GetParentRow, GetParentRows ... methods (calling the relation using its name as string). LINQ-to-DataSet is just doing queries against the old, normal DataSet. LINQ gives you compile-time checking (strongly typed) instead of using SQL strings which the compiler doesn't check.* LINQ saves a lot of time and code (a simple LINQ query can save you for/foreach loops ...).* LINQ makes your code more readable and maintainable.* You can use the same LINQ query with different data sources (assuming they have the same member names or you'll have to do little modifications).* LINQ-to-SQL works only with SQL Server 2005 (and higher) while LINQ-to-Entities (Entity Framework) is more general and works with other databases as well. * Applies to LINQ in general. Eslam Afifi
  • Linq to dataset examples

    csharp asp-net linq tutorial
    3
    0 Votes
    3 Posts
    0 Views
    C
    There are really nice samples on MSDN: LINQ to DataSet Samples[^] 101 C# LINQ Samples[^] or 101 Visual Basic LINQ Samples[^] Calin
  • masterpage setting

    help
    2
    0 Votes
    2 Posts
    0 Views
    A
    Don't do anything. A blank page would run on every browser and every resolution. If only you can provide some specifics. with the data you have provided, no one will have a damn clue of what issue you are facing with. Edit- Forgot to mention, if you do decide to provide some more information and this issue is related to ASP.Net then, there is a specific forum with "ASP.Net" expertise ASP.Net Forum[^]
  • Snap to Object feature [modified]

    csharp visual-studio wpf help tutorial
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • 0 Votes
    2 Posts
    0 Views
    E
    Add new item -> LINQ to SQL classes Drag and drop tables and stored procedures you want from the Server Explorer (or Database Explorer). Eslam Afifi