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
  • Mapping tinyint column to an enum - SOLVED

    php visual-studio com help question
    2
    0 Votes
    2 Posts
    0 Views
    R
    Hi, I ran into the same problem but the way to fix it for me was to prefix the enum type name with global:: I ended up with the following dbml fragment: <Column Name="Foo" Type="**global::**MyNamespace.Foo" DbType="TinyInt NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
  • [Message Deleted]

    3
    0 Votes
    3 Posts
    1 Views
    S
    Parvez, I found this solution, thanks. Apart try to help me in the new message I posted. regards Sajid
  • Dynamic use of Restriction Operator in a linq query

    csharp database linq
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • How to insert relational data ? [modified]

    tutorial question
    2
    0 Votes
    2 Posts
    1 Views
    A
    syntax
  • How to use AutoExtender Control with Linq to Sql

    csharp database linq help tutorial
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • update table using linq

    database csharp linq help question
    2
    0 Votes
    2 Posts
    0 Views
    A
    I cant get you. Means you cant get the data from the database and check with the existing value ?? :confused::confused: Abhishek Sur My Latest Articles **Create CLR objects in SQL Server 2005 C# Uncommon Keywords Read/Write Excel using OleDB **Don't forget to click "Good Answer" if you like to.
  • Linq To Object query

    database csharp linq data-structures question
    2
    0 Votes
    2 Posts
    0 Views
    E
    .Skip(m).Take(n) Eslam Afifi
  • 0 Votes
    4 Posts
    0 Views
    P
    LINQ was introduced as part of .NET 3, so isn't (strictly speaking) available for .NET 2. You can find a way to work with LINQ here[^] however. It's clunky though. "WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes. My blog | My articles | MoXAML PowerToys | Onyx
  • List issue

    csharp mcp help tutorial
    2
    0 Votes
    2 Posts
    1 Views
    P
    I gave an indication of how to do this in my reply here[^]. "WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes. My blog | My articles | MoXAML PowerToys | Onyx
  • " What the use of LINQ ? How to work with LINQ? "

    tutorial csharp linq question
    2
    0 Votes
    2 Posts
    1 Views
    A
    I recommend to read books first... Basics should be very strong then go to professional examples. :thumbsup: Abhishek Sur My Latest Articles **Create CLR objects in SQL Server 2005 C# Uncommon Keywords Read/Write Excel using OleDB **Don't forget to click "Good Answer" if you like to.
  • Enumerating Annonymous types

    csharp css mcp help question
    4
    0 Votes
    4 Posts
    1 Views
    P
    ghumman63 wrote: it means i will have to create some other classes for handling this scenario , is not that extra coding ? Yes. Alternatively, you return the full data and then pull out the subset you need - the choice is yours. "WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes. My blog | My articles | MoXAML PowerToys | Onyx
  • Why can't this cast be done?

    question learning csharp linq testing
    4
    0 Votes
    4 Posts
    1 Views
    D
    Except does not return a list, but an enumerator that will calculate the results on demand. This is how all LINQ methods work (well, those that return IEnumerable): the result isn't calculated until it is used. It would be strange to have an implicit cast that has a side effect (evaluating the query).
  • Cases in Linq

    csharp database linq mcp
    3
    0 Votes
    3 Posts
    0 Views
    T
    thanks, i actually have done like the link u sent , but i am looking that if there is any linq native case syntex. Tauseef A Khan MCP Dotnet framework 2.0.
  • Cast Error

    help csharp asp-net linq
    4
    0 Votes
    4 Posts
    0 Views
    P
    There are alternatives for multiple rows, such as ToList(); in place of SingleOrDefault(); "WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes. My blog | My articles | MoXAML PowerToys | Onyx
  • Is this possible with a LINQ to XML query???

    csharp database linq xml help
    2
    0 Votes
    2 Posts
    0 Views
    M
    You should first make a query for getting all totals for each alias and date: var flatteningQuery = from statement in doc.Root.Element("FlexStatements").Descendants("FlexStatement") from summary in statement.Element("EquitySummaryInBase").Descendants("EquitySummaryByReportDateInBase") select new { Alias = statement.Element("AccountInformation").Attribute("acctAlias").Value, Date = summary.Attribute("reportDate").Value, Total = summary.Attribute("total").Value }; Then, you can group the result from the previous query for each date, getting the list of all alias-total pair corresponding to report dates: var groupedQuery = from row in flatteningQuery group row by row.Date into dateGroup select new { Date = dateGroup.Key, Values = from item in dateGroup select new { Alias = item.Alias, Total = item.Total } };
  • Can not Implicitly Convert

    database csharp linq announcement
    5
    0 Votes
    5 Posts
    1 Views
    Q
    Thank you Ghumman Sahib Actually I was try to get data in way that is not supported by LINQ query Now I have changed my code to following It is working DataEntities data = new DataEntities(); Category cat = (from c in data.Categorys where c.ID == CategoryID select c).First(); IList<Definition> defintions = (from d in data.Definitions.Include("Versions").Include("Versions.CheckedOutTo") where d.Category.ID == cat.ID select d).ToList(); IList<DynamicForms.Data.Version> versions=null; List<Guid> Ids = new List<Guid>(); if (defintions.Count > 0) { versions = defintions.SelectMany(d => d.Versions).ToList(); var Latestversions = from v in data.Versions.Include("Definition") group v by v.Definition.ID into g select new { DefinitionID = g.Key, LatestVersion = g.Max(v => v.Number) }; versions = (from vers in versions from lvers in Latestversions where vers.Definition.ID == lvers.DefinitionID && vers.Number == lvers.LatestVersion select vers).ToList(); Grid.DataSource = versions; Grid.DataBind(); }
  • multiple classes

    csharp linq mcp tutorial question
    2
    0 Votes
    2 Posts
    0 Views
    P
    When the Linq classes are generated, they are in separate classes - the issue you have is that they are in one file. Fortunately, these classes are partial classes so you can place your custom implication in a separate file, as just another part of the partial class. "WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes. My blog | My articles | MoXAML PowerToys | Onyx
  • 0 Votes
    7 Posts
    3 Views
    T
    you will have to create a procedure for that in order to insert values in the child table but not in the parent table . Tauseef A Khan MCP Dotnet framework 2.0.
  • Get next record !!!!!

    tutorial question
    4
    0 Votes
    4 Posts
    0 Views
    J
    var q = context.Student.where(s=>s.id==1).FirstOrDefault();
  • Dynamic columns from 2 joined tables

    database csharp linq help tutorial
    2
    0 Votes
    2 Posts
    1 Views
    M
    Well I fixed this problem, chucked Linq and went back to TSQL, took me a couple of hours to craft the procedure but I got the job done. I took one look at Dynamic Linq, which seems to assume a strongly type dataset every time and shuddered in horror. I despise dynamic TSQL and I think Linq to Dataset leaves a LOT to be desired, I can't imagine trying to debug dynamic Linq. I feel we are creating a support nightmare with linq and Lambda. Never underestimate the power of human stupidity RAH