Click here to Skip to main content
15,891,770 members
Home / Discussions / C#
   

C#

 
QuestionTimeStamp to PDF Pin
Member 119141971-Sep-16 22:06
Member 119141971-Sep-16 22:06 
QuestionSuggesstions on saving 100s of rowsto the database Pin
Giridhar Aruri1-Sep-16 15:27
Giridhar Aruri1-Sep-16 15:27 
AnswerRe: Suggesstions on saving 100s of rowsto the database Pin
OriginalGriff1-Sep-16 20:22
mveOriginalGriff1-Sep-16 20:22 
AnswerRe: Suggesstions on saving 100s of rowsto the database Pin
Eddy Vluggen1-Sep-16 23:10
professionalEddy Vluggen1-Sep-16 23:10 
QuestionNeed to cancel BackgroundWorker Pin
David_411-Sep-16 13:01
David_411-Sep-16 13:01 
AnswerRe: Need to cancel BackgroundWorker Pin
Pete O'Hanlon1-Sep-16 21:01
mvePete O'Hanlon1-Sep-16 21:01 
GeneralRe: Need to cancel BackgroundWorker Pin
David_416-Sep-16 8:12
David_416-Sep-16 8:12 
GeneralRe: Need to cancel BackgroundWorker Pin
Pete O'Hanlon6-Sep-16 9:39
mvePete O'Hanlon6-Sep-16 9:39 
AnswerRe: Need to cancel BackgroundWorker Pin
Gerry Schmitz3-Sep-16 6:53
mveGerry Schmitz3-Sep-16 6:53 
GeneralRe: Need to cancel BackgroundWorker Pin
David_416-Sep-16 8:20
David_416-Sep-16 8:20 
GeneralRe: Need to cancel BackgroundWorker Pin
Gerry Schmitz6-Sep-16 9:08
mveGerry Schmitz6-Sep-16 9:08 
GeneralRe: Need to cancel BackgroundWorker Pin
David_416-Sep-16 9:14
David_416-Sep-16 9:14 
GeneralRe: Need to cancel BackgroundWorker Pin
David_416-Sep-16 9:18
David_416-Sep-16 9:18 
GeneralRe: Need to cancel BackgroundWorker Pin
Gerry Schmitz6-Sep-16 9:48
mveGerry Schmitz6-Sep-16 9:48 
GeneralRe: Need to cancel BackgroundWorker Pin
David_416-Sep-16 10:05
David_416-Sep-16 10:05 
GeneralRe: Need to cancel BackgroundWorker Pin
Gerry Schmitz6-Sep-16 10:25
mveGerry Schmitz6-Sep-16 10:25 
QuestionFacebook login form Pin
Launchar31-Aug-16 18:14
Launchar31-Aug-16 18:14 
AnswerRe: Facebook login form Pin
Mycroft Holmes31-Aug-16 19:38
professionalMycroft Holmes31-Aug-16 19:38 
AnswerRe: Facebook login form Pin
Nathan Minier1-Sep-16 0:59
professionalNathan Minier1-Sep-16 0:59 
QuestionPRINT DATE TIME & TEXT ON PICTUREBOX Pin
Member 1271206730-Aug-16 18:11
Member 1271206730-Aug-16 18:11 
AnswerRe: PRINT DATE TIME & TEXT ON PICTUREBOX Pin
Mycroft Holmes30-Aug-16 20:17
professionalMycroft Holmes30-Aug-16 20:17 
QuestionGet value from string and pass it to another field Pin
Member 1105143930-Aug-16 11:50
Member 1105143930-Aug-16 11:50 
Hello all,

So I need your help to get a value from a string and put it on other field. I saw tons of exemples around, but I have several issues.

So I have a field named "Comments". I need to check if that field has some words on it. After find one of those words, I need to get the value after that word and pass it to another field named "Selo".

So far I have this code:

C#
private string selos;
         public string Selos
         {
             get { return selos; }
5.             set
             {
                 string[] stringToCheck = new string[] { "Selo:", "selo:", "Selos:", "selos:" };
                 string[] result;
                     if(string.IsNullOrEmpty(Comments) == true)
10.                     {
                         SetPropertyValue("Selos", ref selos, "None");
                     }
                     else
                     {
15.                         result = Comments.Split(stringToCheck, StringSplitOptions.RemoveEmptyEntries);
                         SetPropertyValue("Selos", ref selos, result[0]);
                 }
          }
         }


Issue 1: I filled the fields "Comments" but in VisualStudio - Watch, this field is allways null, so everything else is null. Issue 2: When I change the "Comments" data, the VS Watch recognizes changes and passes all the data in this field to the "Selos" field, which is not what I want. I just want data after stringToCheck...

Here's an exemple:

Comments: Everythings OK. Selo: Q457896; Q457897

Now, the code puts in "Selo" field: Everythings OK. Selo: Q457896; Q457897, however, it doesn't save this value in the database. What I really want is:

Field Selo - Q457896; Q457897

Please I need your help to get this working... What am I missing/doing wrong here?

Thanks
AnswerRe: Get value from string and pass it to another field Pin
Simon_Whale30-Aug-16 13:11
Simon_Whale30-Aug-16 13:11 
AnswerRe: Get value from string and pass it to another field Pin
Dave Kreskowiak30-Aug-16 13:17
mveDave Kreskowiak30-Aug-16 13:17 
Questionobject reference not set to an instance of an object Pin
mmiklauz29-Aug-16 6:38
mmiklauz29-Aug-16 6:38 

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.