Questions tagged [stringcollection]

Represents a collection of strings in C#

40 questions
39
votes
3 answers

Performance concern: StringCollection vs List

I was wondering when I should use List< string > and when I should use StringCollection. Let's say that I have to deal with large number of strings (like text files of 10mb). I know that List< T > provides more powerful functions than …
GianT971
  • 4,385
  • 7
  • 34
  • 46
11
votes
4 answers

Initializing a StringCollection Setting

I am writing an application, and I want to store a list of files selected by the user. Currently, one of my settings is a StringCollection called filesToFetch, which is User scoped and contains the paths of all the files that the program should…
Eric
  • 688
  • 2
  • 9
  • 23
5
votes
4 answers

How to write contents of System.Collections.Specialized.StringCollection to file?

I have had no luck searching the obvious places for an answer to why using File.WriteAllLines(); doesn't work when outputting a StringCollection: static System.Collections.Specialized.StringCollection infectedLog = new…
user1192312
4
votes
1 answer

I am getting error like "constructor on type 'system.string' cannot found" for a User Control in C#?

For a usercontrol TextBox i am creating properties like AutoCompleteCustomSource, AutoCompleteMode and AutoCompleteSource: public virtual AutoCompleteStringCollection AutoCompleteCustomSource { get { return txtLocl.AutoCompleteCustomSource; }…
Anjali
  • 1,680
  • 4
  • 26
  • 48
3
votes
3 answers

Using StringCollection specified in Application Settings in a LINQ-to-Entities Query

In my application, I have Property Setting which is of type String.Collections.Specialized.StringCollection. It contains a list of customer codes such as MSFT, SOF, IBM etc. I'm trying to use this in a Linq-to-Entities query in the where clause:…
FMFF
  • 1,652
  • 4
  • 32
  • 62
3
votes
2 answers

Why is calling StringCollection from Settings slow?

I am writing a small .NET Windows Forms app, and I use the built-in Visual Studio settings to manage my programs config. I noticed an issue however that after I had added a StringCollection setting (to store a list of recently accessed documents),…
Alex McBride
  • 6,881
  • 3
  • 29
  • 30
3
votes
1 answer

Find the overlap of a set of equal length string?

There are 1 million of equal length strings(short string).For example abcdefghi fghixyzyz ghiabcabc zyzdddxfg . . . I want to find pair-wise overlap of two string.The overlap of A"abcdefghi" and B"fghixyzyz" is "fghi",which is the maximal suffix of…
2
votes
1 answer

Difference between Collection And StringCollection

As the title suggests I would like to know what the difference is between a collection for which I have to set the type of items and all the specialized collections for only one datatype. Does it matter which one I use? And also is there a…
Andahari
  • 35
  • 1
  • 5
1
vote
2 answers

How to convert StringCollection to BindingList

Is it possible to convert a StringCollection variable to a BindingList, and then back? I am trying to bind a StringCollection to a DataGridView, and I am struggling to make it work. I want to do the same thing with a StringDictionary. Do I need to…
rogdawg
  • 687
  • 3
  • 11
  • 33
1
vote
1 answer

C# Up Down Arrow for Next/Previous in a string list/collection

I am a bit confused here: Windows Forms Application, in C#. Let's say I have a text box. And when the user enters text into that text box, and submits that to the server, it populates what the user wrote into an internal List. Now, let's…
user674311
1
vote
1 answer

WPF binding textbox to item of a string collection

I have a StringCollection in my settings and want to bind 1 of the items to a label. This is how it works. xmlns:p="clr-namespace:MyNamespace.Properties"
1
vote
4 answers

How to combine / merge two StringCollection into one in C#

How to combine / merge two StringCollection in C# var collection1 = new StringCollection () { "AA", "BB", "CC" }; var collection2 = new StringCollection () { "DD", "EE", "FF" }; var resultCollection = collection1 + collection2 ; // TODO …
Rahul Uttarkar
  • 3,367
  • 3
  • 35
  • 40
1
vote
0 answers

How to edit StringCollection in C# PropertyGrid? ["Constructor in type 'System.string' not found"]

Using Settings Editor I created some user settings for my application. In one specific instance, I need a setting to be an array of strings. The only option I encounter is StringCollection: Choosing the data type in settings editor When I edit the…
B_K
  • 11
  • 1
1
vote
1 answer

System.Collections.Specialized.StringCollection settings work fine in Debug and Release but crash on Deployment?

For my latest WPF application, I've been using an System.Collections.Specialized.StringCollection to save and load strings. My current system works like a charm in Debug and Release, but when deployed to ClickOnce, the application crashes as soon as…
ThomasFrew
  • 11
  • 3
1
vote
1 answer

Copying ComboBox Items to a StringCollection in C#

How can I copy a collection of items in a comboBox to a StringCollection in my C# application? I'm only interested in capturing the string text for each item in their respective order. I am trying to make a MRU file list that is saved between…
Jim Fell
  • 13,750
  • 36
  • 127
  • 202
1
2 3