Click here to Skip to main content
16,018,249 members
Home / Discussions / C#
   

C#

 
QuestionWrite Dataset to SQL Pin
GermanDM22-Aug-07 3:50
GermanDM22-Aug-07 3:50 
AnswerRe: Write Dataset to SQL Pin
Vasudevan Deepak Kumar22-Aug-07 5:00
Vasudevan Deepak Kumar22-Aug-07 5:00 
AnswerRe: Write Dataset to SQL Pin
costavo22-Aug-07 5:00
costavo22-Aug-07 5:00 
AnswerRe: Write Dataset to SQL Pin
Giorgi Dalakishvili22-Aug-07 5:01
mentorGiorgi Dalakishvili22-Aug-07 5:01 
Questionstring.IndexOf help Pin
solutionsville22-Aug-07 3:28
solutionsville22-Aug-07 3:28 
AnswerRe: string.IndexOf help Pin
Martin#22-Aug-07 3:45
Martin#22-Aug-07 3:45 
GeneralRe: string.IndexOf help Pin
solutionsville22-Aug-07 4:06
solutionsville22-Aug-07 4:06 
GeneralRe: string.IndexOf help Pin
Martin#22-Aug-07 4:30
Martin#22-Aug-07 4:30 
solutionsville wrote:
I am not sure I understand how I take the value of the textbox as a string and pass it to the above routine

You don't need to do that.

The method I posted, takes a string[] as parameter for the lines to search.
The TextBox class has a property called "Lines" which is type of string[], and this will be passed as parameter.
FindLinesOverSearchString(yourTextBox.Lines, "searchstring");

The second parameter is quit simple the string to search.

The result is in my case a dynamic collection of the type: System.Collections.Specialized.StringCollection.
This class has an "Add" method, which will be used to add the matching line to the collection.

If you now have the result and want to show it in a second multiline textbox:
//Again the method call for the search
StringCollection resultLines = FindLinesOverSearchString(yourTextBox.Lines, "searchstring");
 
//create a new instance of string[], with the needed lenght
string[] resultAsStringArray = new string[resultLines.Count];
//copy data of StringCollection to the new string[]
resultLines.CopyTo(resultAsStringArray,0);
//path it to the result TextBox "Lines" property
yourTextBoxResult.Lines = resultAsStringArray;


Hope it helps!

All the best,

Martin

GeneralRe: string.IndexOf help Pin
solutionsville22-Aug-07 4:43
solutionsville22-Aug-07 4:43 
GeneralRe: string.IndexOf help Pin
Martin#22-Aug-07 4:47
Martin#22-Aug-07 4:47 
AnswerRe: string.IndexOf help Pin
Justin Perez22-Aug-07 3:46
Justin Perez22-Aug-07 3:46 
QuestionC# DATE FORMAT Pin
KETAN.RK22-Aug-07 3:09
KETAN.RK22-Aug-07 3:09 
AnswerRe: C# DATE FORMAT Pin
J4amieC22-Aug-07 3:10
J4amieC22-Aug-07 3:10 
GeneralRe: C# DATE FORMAT Pin
KETAN.RK22-Aug-07 5:01
KETAN.RK22-Aug-07 5:01 
GeneralRe: C# DATE FORMAT Pin
J4amieC22-Aug-07 5:56
J4amieC22-Aug-07 5:56 
AnswerRe: C# DATE FORMAT Pin
Levon Nalbandyan22-Aug-07 3:32
Levon Nalbandyan22-Aug-07 3:32 
Questiontooltips Pin
Sunshine Always22-Aug-07 2:11
Sunshine Always22-Aug-07 2:11 
AnswerRe: tooltips Pin
SpiveyC#22-Aug-07 3:45
SpiveyC#22-Aug-07 3:45 
GeneralRe: tooltips Pin
Sunshine Always22-Aug-07 3:58
Sunshine Always22-Aug-07 3:58 
GeneralRe: tooltips Pin
Luc Pattyn22-Aug-07 4:20
sitebuilderLuc Pattyn22-Aug-07 4:20 
QuestionWierd req from boss Pin
SpiveyC#22-Aug-07 2:10
SpiveyC#22-Aug-07 2:10 
AnswerRe: Wierd req from boss Pin
Giorgi Dalakishvili22-Aug-07 2:12
mentorGiorgi Dalakishvili22-Aug-07 2:12 
GeneralRe: Wierd req from boss Pin
PIEBALDconsult22-Aug-07 5:12
mvePIEBALDconsult22-Aug-07 5:12 
GeneralRe: Wierd req from boss Pin
Dan Neely22-Aug-07 5:37
Dan Neely22-Aug-07 5:37 
GeneralRe: Wierd req from boss Pin
PIEBALDconsult22-Aug-07 5:58
mvePIEBALDconsult22-Aug-07 5:58 

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.