Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
M

Member 7278598

@Member 7278598
About
Posts
3
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • LINQ version equivalent
    M Member 7278598

    Yes thank you, exactly what i wanted. ;)

    C# csharp database linq tutorial announcement

  • LINQ Equivalent
    M Member 7278598

    I am trying to get my head around LINQ and am going through some old code to practice, below is some code that i want to convert but cannot work out how to do it. anyone have any ideas please. Reading a csv file, getting first element only with some blank lines and should be able to populate combobox with something like: cboSiteLocation.Items.AddRange(lines.ToArray());

    <pre lang="text">

    using (StreamReader sr = new StreamReader(filepath)) { IEnumerable&lt;string&gt; lines = File.ReadLines(filepath); // LINQ query here string[] element; foreach (string line in lines) { if (!string.IsNullOrEmpty(line)) { element = line.Split(','); this.cboSiteLocation.Items.Add(element[0].Trim()); } Thanks in advance

    LINQ csharp database linq tutorial

  • LINQ version equivalent
    M Member 7278598

    I am trying to get my head around LINQ and am going through some old code to practice, below is some code that i want to convert but cannot work out how to do it.
    anyone have any ideas please.
    Reading a csv file, getting first element only with some blank lines and should be able to populate combobox with something like:
    cboSiteLocation.Items.AddRange(lines.ToArray());

    using (StreamReader sr = new StreamReader(filepath))
    {
    IEnumerable<string> lines = File.ReadLines(filepath); // LINQ query here

                    string\[\] element;
    
                    foreach (string line in lines)
                    {
                        if (!string.IsNullOrEmpty(line))
                        {
                            element = line.Split(',');
                            this.cboSiteLocation.Items.Add(element\[0\].Trim());
                        }
                    }                    
                }
    

    Thanks in advance

    C# csharp database linq tutorial announcement
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups