Click here to Skip to main content
15,889,527 members
Home / Discussions / C#
   

C#

 
GeneralRe: www.mycoolsoft.net | My first free software:MyShortcuts Pin
Gareth H26-Mar-08 6:52
Gareth H26-Mar-08 6:52 
GeneralRe: www.mycoolsoft.net | My first free software:MyShortcuts Pin
J$26-Mar-08 7:11
J$26-Mar-08 7:11 
GeneralRe: www.mycoolsoft.net | My first free software:MyShortcuts Pin
dshyryayev26-Mar-08 7:42
dshyryayev26-Mar-08 7:42 
GeneralRe: www.mycoolsoft.net | My first free software:MyShortcuts Pin
J$26-Mar-08 7:56
J$26-Mar-08 7:56 
GeneralRe: www.mycoolsoft.net | My first free software:MyShortcuts Pin
dshyryayev26-Mar-08 8:18
dshyryayev26-Mar-08 8:18 
GeneralSSIS Package Pin
kibromg26-Mar-08 5:30
kibromg26-Mar-08 5:30 
GeneralCross post - please ignore Pin
pmarfleet26-Mar-08 10:26
pmarfleet26-Mar-08 10:26 
QuestionHow to refresh data from one Form to another Pin
ziwez026-Mar-08 5:20
ziwez026-Mar-08 5:20 
Ok, this is doing my head in now, how can it be so hard...?

Right I have 2 Forms (Form1 and Form2)
All I want to do is refresh data on Form1 from Form2

Form1 displays some data from a db.
Form1 also has a button that opens Form2
----Form1----------------------------------
private void hplNewAppointment_Click(object sender, EventArgs e)
{
Form2 OpenNewForm = new Form2();
OpenNewForm.ShowInTaskbar = false;
OpenNewForm.TopMost = true;
OpenNewForm.Show();
}
public void RefreshScheduler()
{
this.tblScheduleTableAdapter.ClearBeforeFill.Equals(true);
this.tblScheduleTableAdapter.Fill(this.dS_tblSchedule.tblSchedule);
}
---------------------------------------------
All good so far, Form2(OpenNewForm) allows me to enter a new record into the db, when I close Form2(OpenNewForm) I want to refresh the data on Form1

------Form2(OpenNewForm)------------------
public OpenNewForm()
{
InitializeComponent();
form1 = new Form1();
}
private void btnClose_Click(object sender, EventArgs e)
{
form1.RefreshScheduler();
this.Close();
}
--------------------------------------------
Ok so I can access the method on Form1 but it does not refresh the data...
How can I fix this????
thanks
AnswerRe: How to refresh data from one Form to another Pin
Gareth H26-Mar-08 5:37
Gareth H26-Mar-08 5:37 
AnswerRe: How to refresh data from one Form to another Pin
ziwez026-Mar-08 23:01
ziwez026-Mar-08 23:01 
QuestionGetting COM Exception in Word 2003 Component. Pin
rokrzone26-Mar-08 5:17
rokrzone26-Mar-08 5:17 
GeneralRe: Getting COM Exception in Word 2003 Component. Pin
Herman<T>.Instance26-Mar-08 5:33
Herman<T>.Instance26-Mar-08 5:33 
GeneralBlock File Pin
ellllllllie26-Mar-08 4:35
ellllllllie26-Mar-08 4:35 
GeneralRe: Block File Pin
Eduard Keilholz26-Mar-08 4:49
Eduard Keilholz26-Mar-08 4:49 
GeneralRe: Block File Pin
ellllllllie26-Mar-08 5:07
ellllllllie26-Mar-08 5:07 
GeneralRe: Block File Pin
Eduard Keilholz26-Mar-08 6:21
Eduard Keilholz26-Mar-08 6:21 
GeneralRe: Block File Pin
ellllllllie26-Mar-08 6:42
ellllllllie26-Mar-08 6:42 
GeneralRe: Block File Pin
Christian Graus26-Mar-08 10:02
protectorChristian Graus26-Mar-08 10:02 
GeneralRe: Block File Pin
Christian Graus26-Mar-08 10:01
protectorChristian Graus26-Mar-08 10:01 
GeneralRe: Block File Pin
Paul Conrad26-Mar-08 11:37
professionalPaul Conrad26-Mar-08 11:37 
GeneralRe: Block File Pin
Pete O'Hanlon26-Mar-08 11:53
mvePete O'Hanlon26-Mar-08 11:53 
GeneralSMS gateway Pin
NewToAspDotNet26-Mar-08 3:45
NewToAspDotNet26-Mar-08 3:45 
GeneralRe: SMS gateway Pin
led mike26-Mar-08 4:34
led mike26-Mar-08 4:34 
GeneralRe: SMS gateway Pin
NewToAspDotNet26-Mar-08 5:06
NewToAspDotNet26-Mar-08 5:06 
GeneralRe: SMS gateway Pin
led mike26-Mar-08 5:10
led mike26-Mar-08 5:10 

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.