Click here to Skip to main content
15,881,424 members
Home / Discussions / C#
   

C#

 
GeneralRe: Combining two or three solution in visual C# 2008 Pin
KaKoten27-Jun-14 20:40
KaKoten27-Jun-14 20:40 
GeneralRe: Combining two or three solution in visual C# 2008 Pin
Dave Kreskowiak28-Jun-14 3:55
mveDave Kreskowiak28-Jun-14 3:55 
QuestionOut Putting Graph in Debug Window Pin
computerpublic27-Jun-14 8:06
computerpublic27-Jun-14 8:06 
AnswerRe: Out Putting Graph in Debug Window Pin
Dave Kreskowiak27-Jun-14 8:15
mveDave Kreskowiak27-Jun-14 8:15 
AnswerRe: Out Putting Graph in Debug Window Pin
Gerry Schmitz27-Jun-14 9:59
mveGerry Schmitz27-Jun-14 9:59 
QuestionFilter & Auto complete for dropdownlistfor (MVC) Pin
Cathylou Barbado27-Jun-14 0:06
Cathylou Barbado27-Jun-14 0:06 
AnswerRe: Filter & Auto complete for dropdownlistfor (MVC) Pin
thatraja27-Jun-14 1:12
professionalthatraja27-Jun-14 1:12 
QuestionLINQ version equivalent Pin
Member 727859826-Jun-14 23:13
Member 727859826-Jun-14 23:13 
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

AnswerRe: LINQ version equivalent Pin
Pete O'Hanlon27-Jun-14 4:00
mvePete O'Hanlon27-Jun-14 4:00 
GeneralRe: LINQ version equivalent Pin
Member 727859828-Jun-14 1:16
Member 727859828-Jun-14 1:16 
GeneralRe: LINQ version equivalent Pin
Pete O'Hanlon28-Jun-14 2:51
mvePete O'Hanlon28-Jun-14 2:51 
QuestionWPF Project Pin
Wesley2026-Jun-14 22:34
Wesley2026-Jun-14 22:34 
AnswerRe: WPF Project Pin
OriginalGriff26-Jun-14 23:04
mveOriginalGriff26-Jun-14 23:04 
AnswerRe: WPF Project Pin
Wayne Gaylard26-Jun-14 23:05
professionalWayne Gaylard26-Jun-14 23:05 
AnswerRe: WPF Project Pin
Wesley2026-Jun-14 23:17
Wesley2026-Jun-14 23:17 
GeneralRe: WPF Project Pin
thatraja26-Jun-14 23:44
professionalthatraja26-Jun-14 23:44 
GeneralRe: WPF Project Pin
Member 1072960427-Jun-14 0:15
Member 1072960427-Jun-14 0:15 
QuestionXML Parsing in Windows Phone 8 Pin
Junaid Javed26-Jun-14 21:08
Junaid Javed26-Jun-14 21:08 
AnswerRe: XML Parsing in Windows Phone 8 Pin
OriginalGriff26-Jun-14 22:11
mveOriginalGriff26-Jun-14 22:11 
GeneralRe: XML Parsing in Windows Phone 8 Pin
Junaid Javed26-Jun-14 23:42
Junaid Javed26-Jun-14 23:42 
Questionadd a streamer to windows kernel Pin
Member 1090881226-Jun-14 13:52
Member 1090881226-Jun-14 13:52 
GeneralRe: add a streamer to windows kernel Pin
Richard MacCutchan26-Jun-14 19:37
mveRichard MacCutchan26-Jun-14 19:37 
QuestionMEF Windows7 Service Pin
Member 1027274826-Jun-14 9:54
Member 1027274826-Jun-14 9:54 
AnswerRe: MEF Windows7 Service Pin
jschell26-Jun-14 10:28
jschell26-Jun-14 10:28 
QuestionEditing Local Machine Policies In a Windows Form Application Pin
Member 1024124126-Jun-14 4:54
Member 1024124126-Jun-14 4:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.