Null Reference in editing a task scheduler trigger in c# -


Why (T! = Null) is always empty Why help .. whenever I try to get value in variable name I always get into the second part, but I'm sure the value in the tet variable is value.

  Private Zero Button 3_Click (Object Sender, Event AGS E) {try (if (search == "") {} Else {if (textbox1.Text == "") {MessageBox.Show ("Select one task or search one");} Else {search = textBox1.Text;}} If (search! = Null) {t = taskss.OpenTask (search); if (textbox2.Text! = "") { Short hour = short.Parse (textbox2.Text.Substring (0, 2)); short minutes = small text (text box 2. text shutting (3, 2)); if (t! = Null) // it Do not know why {foreach (Trigger in Tritter Trigger) {if (tr is startable tritter) {(tr as startabletrigger). Starthur = Hour; (tr as StartableTrigger) Star Minute = minute;}} T. Save (); t.Close ();} Tasks.Dispose (); Button 2. Eligible = True; TextBox3. Valid = true; Search = "";} Else {Messagebox.Show ( "Enter Time");}}} Hold (Exception B) {Message Box. Show (B. Tech String ()); // MessageBox.Show ("Choose a task from the list");}}   

Help people .. Well I tried to debug it, but I got a break.

t is zero because taskss.OpenTask (search) return tap. There is probably no work that matches your search criteria.

Why are you taking out work in the first place?

Comments