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
  • Why bother with EF?

    csharp question wpf database wcf
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • 0 Votes
    2 Posts
    0 Views
    J
    Can you give us more details about the exception? Religiously blogging on the intarwebs since the early 21st century: Kineti L'Tziyon Judah Himango
  • win7 sdk

    question csharp mcp
    2
    0 Votes
    2 Posts
    0 Views
    J
    Wrong forum. Religiously blogging on the intarwebs since the early 21st century: Kineti L'Tziyon Judah Himango
  • win 7

    csharp mcp beta-testing question
    2
    0 Votes
    2 Posts
    0 Views
    J
    Wrong forum. Religiously blogging on the intarwebs since the early 21st century: Kineti L'Tziyon Judah Himango
  • Linq to Entity - SQL NOT IN

    database csharp linq tutorial
    4
    0 Votes
    4 Posts
    0 Views
    J
    Have you tried the Except method? I'm not sure how Linq-to-Entities maps that, but I assume it's smart enough to do it well. Religiously blogging on the intarwebs since the early 21st century: Kineti L'Tziyon Judah Himango
  • Convert SQL query to LINQ

    database csharp linq help learning
    3
    0 Votes
    3 Posts
    0 Views
    J
    thanks i will try this...
  • How I can use it in Web Application Using C#.Net

    csharp database help
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • 0 Votes
    1 Posts
    0 Views
    No one has replied
  • LINQ update with NULL value.

    csharp linq help question announcement
    3
    0 Votes
    3 Posts
    0 Views
    M
    Hey mac thanks for the reply man.I tried both ways yaar,if the problem was with my Nullable types then it should not even insert NULL Datetime values with the same function i used.Any ways thanks for the reply and even if you get any solution please post it. Thanks, maxy
  • 0 Votes
    3 Posts
    0 Views
    A
    That is what I try to do as You can see in the code, it must be something with the master detail thing. If I have a single table and do the same thing it works. My project can be downloaded from my skydrive it is a vs2008 project. http://cid-5bf7292cf8016af6.skydrive.live.com/self.aspx/.Public[^] modified on Saturday, May 9, 2009 4:02 AM
  • Problem with Join and grouping

    help database csharp linq sales
    2
    0 Votes
    2 Posts
    0 Views
    T
    I got it to group now but I have trouble when trying to bind it to a Datalist Protected Sub LinqDataSource1_Selecting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.LinqDataSourceSelectEventArgs) Handles LinqDataSource1.Selecting Dim prod = From x In (From m In db.ProductSpecs Join v In db.ProductVerbages On m.material Equals v.material _ Where m.subclass.Contains(ViewState("matcat")) _ Select New Product With {.Material = m.material, .MarketingTagline = v.marketing_tagline, .IDKey = m.idkey, .ProductPhoto = m.product_photo}) _ Group x By x.ProductPhoto Into mg = Group _ Select mg Dim pl As New List(Of Product) For Each item In prod.ToArray() pl = item.ToList 'MsgBox(item.ToString) 'For Each x In item.ToArray ' MsgBox(x.ProductPhoto) 'Next Next e.Result = pl End Sub Code for Datalist: <asp:DataList ID="DataList1" DataSourceID="LinqDataSource1" runat="server" BackColor="White" BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px" CellPadding="3" ForeColor="Black" GridLines="Vertical"> <FooterStyle BackColor="#CCCCCC" /> <SelectedItemStyle BackColor="#000099" Font-Bold="True" ForeColor="White" /> <ItemTemplate> <table> <tr> <td style="width:100px; font-weight:bold;"> <asp:ImageButton ID="Image1" Width="40" runat="server" ImageUrl='<%# "~/Images/ProductImages/" + Eval("ProductPhoto").toString() %>' /> <asp:Label ID="materialLabel" runat="server" Text='<%# Eval("Material") %>' /> </td> <td style="width:370px; padding-left: 5px; text-align: left;"> <asp:Label ID="Label" runat="server" TabIndex="1" Text='<%# Eval("MarketingTagline") %>' /> </td> <td style="width:80px; text-align:center;"> <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Eval("Material", "dataSheet.asp
  • linq query group by

    csharp database linq help
    7
    0 Votes
    7 Posts
    0 Views
    W
    Here is a nice example of grouping using Linq public void Linq40() { int[] numbers = { 5, 4, 1, 3, 9, 8, 6, 7, 2, 0 }; var numberGroups = from n in numbers group n by n % 5 into g select new { Remainder = g.Key, Numbers = g }; foreach (var g in numberGroups) { Console.WriteLine("Numbers with a remainder of {0} when divided by 5:", g.Remainder); foreach (var n in g.Numbers) { Console.WriteLine(n); } } } more examples in C# you find : http://msdn.microsoft.com/en-us/vcsharp/aa336746.aspx[^] Hope this will help, Wim
  • LINQ, ERM [modified]

    csharp database linq question
    4
    0 Votes
    4 Posts
    0 Views
    S
    Hi, try this www.codeinlinq.blogspot.com Hope this one can help. Thanks Hi, Please select Good Question if my answer are fit to your Question.
  • Connectivity in ASP.Net 3.5

    csharp asp-net database
    4
    0 Votes
    4 Posts
    0 Views
    S
    Hi, you can visit www.connectionstrings.com. Or in your tools menu (VS2008) you can select Connect to Database. Hope this one can help. Thanks Hi, Please select Good Question if my answer are fit to your Question.
  • WCF using Linq To Entities

    csharp wcf linq oop help
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • LINQ to SQL and Stored Procs

    database csharp linq help question
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • Contains not work instead of "where in" of sql

    database
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • sorting in gridview using linq.........

    help csharp linq algorithms
    4
    0 Votes
    4 Posts
    0 Views
    S
    Hi, base one your code: protected void BindGrid() {   try   {      var employees = from e in DetailContext.Employees select new {e.Emp_Id,         e.Emp_Code, e.F_Name, e.L_Name, e.Designation };      GridView1.DataSource = employees;      GridView1.DataBind();                        }   catch (Exception ex)   {      throw ex;   } } you can add this from e in DetailContext.Employees orderby [columnfield] descending Hope this one can help. Thanks Hi, Please select Good Question if my answer are fit to your Question.
  • Using linq to sort an object collection?

    question csharp linq sales
    5
    0 Votes
    5 Posts
    0 Views
    A
    Hi! Are you sure that the result comes from the new enumerable salesTransaction? Because according to the select, each object in that collection should only have two properties, EmployeeID and TotalPointsEarned. The result looks like the list "list" Andreas Johansson IT Professional at Office IT Partner i Norrbotten Sweden What we don't know. We learn. What you don't know. We teach
  • runtime error "invalidoperation exception" ?

    database help csharp linq question
    3
    0 Votes
    3 Posts
    0 Views
    M
    hi , thanx for ur help... well actually, i was working with a table that had a number of repeated values with different primary keys, i needed only distinct name and it's key so i thought of using a dictionary coz it sounded as if dictionary can store 2 values as opposed to lists... correct me if i am wrong with the idea of dictionary... Anyways , thanx alot and thanx for clarifying the key things...i was confused regarding keys... thanx