Click here to Skip to main content
15,914,594 members
Home / Discussions / C#
   

C#

 
QuestionXmlSerializer and CDATA Pin
theJazzyBrain28-Mar-07 5:15
theJazzyBrain28-Mar-07 5:15 
QuestionConverting a string to currency format Pin
lee.hallows28-Mar-07 5:09
lee.hallows28-Mar-07 5:09 
AnswerRe: Converting a string to currency format Pin
joon vh.28-Mar-07 5:17
joon vh.28-Mar-07 5:17 
QuestionUsing reference parameters when calling an exposed function from a DLL Pin
Dewald28-Mar-07 5:09
Dewald28-Mar-07 5:09 
AnswerRe: Using reference parameters when calling an exposed function from a DLL Pin
m@u28-Mar-07 5:29
m@u28-Mar-07 5:29 
GeneralRe: Using reference parameters when calling an exposed function from a DLL Pin
Dewald28-Mar-07 23:39
Dewald28-Mar-07 23:39 
QuestionGuidance Automation Toolkit or CodeSmith? Pin
wojti28-Mar-07 5:03
wojti28-Mar-07 5:03 
Questioncalling function in parent form from child form Pin
Lordveralix28-Mar-07 4:13
Lordveralix28-Mar-07 4:13 
Hello,

I am having diffiulty in calling a function from the parent form from the child form without having to create a new instance of the parent form.

Parent form spawns child which upon clicking of a button deletes a member from a database. What I need the button to do is to refresh a table on the parent form.

I have tried overriding refresh on the parent form but I still get the same issue: a nullpointerexception and the parent form is closed as well.

The code in the child form is this:

MessageBox.Show("Occurence Deleted!");
this.Parent.Refresh();
this.Close();

This is the override I have in the parent form:

public override void Refresh()
{
DataSet ds = eo.GetSearch();
dataGridView1.DataSource = ds;
dataGridView1.DataMember = "Employees";
}

The exception I am receiveing is:

A first chance exception of type 'System.NullReferenceException' occurred in Occurence Manager.exe
System.NullReferenceException: Object reference not set to an instance of an object.

(which is at the following line : this.Parent.Refresh();

What am I doing wrong?


AnswerRe: calling function in parent form from child form Pin
Pete O'Hanlon28-Mar-07 4:22
mvePete O'Hanlon28-Mar-07 4:22 
GeneralRe: calling function in parent form from child form Pin
Lordveralix28-Mar-07 4:51
Lordveralix28-Mar-07 4:51 
GeneralRe: calling function in parent form from child form Pin
Pete O'Hanlon28-Mar-07 4:54
mvePete O'Hanlon28-Mar-07 4:54 
GeneralRe: calling function in parent form from child form Pin
Lordveralix28-Mar-07 5:13
Lordveralix28-Mar-07 5:13 
GeneralRe: calling function in parent form from child form Pin
Lordveralix28-Mar-07 7:11
Lordveralix28-Mar-07 7:11 
Question[Message Deleted] Pin
pashitech28-Mar-07 3:56
pashitech28-Mar-07 3:56 
AnswerRe: how to find help tools Pin
Judah Gabriel Himango28-Mar-07 4:06
sponsorJudah Gabriel Himango28-Mar-07 4:06 
AnswerRe: how to find help tools Pin
Judah Gabriel Himango28-Mar-07 4:55
sponsorJudah Gabriel Himango28-Mar-07 4:55 
GeneralRe: how to find help tools Pin
pashitech28-Mar-07 5:36
pashitech28-Mar-07 5:36 
QuestionREMOTE INSTALL Pin
waddah_com28-Mar-07 3:55
waddah_com28-Mar-07 3:55 
AnswerRe: REMOTE INSTALL Pin
Judah Gabriel Himango28-Mar-07 4:05
sponsorJudah Gabriel Himango28-Mar-07 4:05 
AnswerRe: REMOTE INSTALL Pin
Judah Gabriel Himango28-Mar-07 4:57
sponsorJudah Gabriel Himango28-Mar-07 4:57 
AnswerRe: REMOTE INSTALL Pin
Vasudevan Deepak Kumar28-Mar-07 7:52
Vasudevan Deepak Kumar28-Mar-07 7:52 
GeneralRe: REMOTE INSTALL Pin
waddah_com30-Mar-07 4:23
waddah_com30-Mar-07 4:23 
QuestionSelecting item in listbox after creating it Pin
sinosoidal28-Mar-07 3:54
sinosoidal28-Mar-07 3:54 
AnswerRe: Selecting item in listbox after creating it Pin
JoeSharp28-Mar-07 3:58
JoeSharp28-Mar-07 3:58 
GeneralRe: Selecting item in listbox after creating it Pin
sinosoidal28-Mar-07 4:02
sinosoidal28-Mar-07 4:02 

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.