|
I think, what you want is "Property"
|
|
|
|
|
stancrm wrote: I think, what you want is "Property"
Thanks stancrm,
Tried it, but not getting required result.
Actually i'm calling Form2 from Form1 . After finishing Form2's function, a value is required from it, so that Form1 can continue its process. I think its more clear now.
_____________________________
Success is not something to wait for, its something to work for.
|
|
|
|
|
uroojkhan wrote: I think its more clear now.
Not really.
Perhaps you could chose the correct terms?
Right now one can only guess what you mean (for example "After finishing Form2's function" - are you calling a method on an instance of Form2? If so, why do you have problems returning a value from this method?)
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
mav.northwind wrote: are you calling a method on an instance of Form2?
No! calling the Form2 for entering a new record in the database. when the record is inserted there is no need to keep it. But here i need the newly iserted record's IDnumber (which is a primary key value) in the Form1, so that it can be inserted as FK in another table from Form1.
_____________________________
Success is not something to wait for, its something to work for.
|
|
|
|
|
Oh boy, you should seriously start reading on OOP so that you can use the correct terms, otherwise people don't know what you're talking about.
I guess what you do is to create and show a dialog instance to perform some DB operations.
Then, when the dialog is closed and control is returned to the caller, you want the caller to be able to access some data Form2 received during the DB operations, right?
You simply have to add a publicly visible property to your Form2 class and set it's value after the insert has been performed.
Then you can query this property from the calling form.
Or you use events for this purpose if you don't want to show Form2 as a modal dialog.
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
Thanks mav.northwind.
The article Passing Values Between Forms (SiblingToSibling part) solved my problem.
Thanks alot for your response and
Best Regards.
_____________________________
Success is not something to wait for, its something to work for.
|
|
|
|
|
mav.northwind wrote: You simply have to add a publicly visible property to your Form2 class and set it's value after the insert has been performed.
Then you can query this property from the calling form.
Its also working. First I tried this technique, but there was my mistake (value assignment to the property on wrong place, which yields nothing). Now its fixed.
Thanks and Regards.
_____________________________
Success is not something to wait for, its something to work for.
|
|
|
|
|
|
|
How to open tabpage when click mouse-right button?
|
|
|
|
|
Hi all
Can anybody send me a sample code how to upload a file to VSS to a specified directory using c#???
Thanx
Akhil
|
|
|
|
|
You dont upload to VSS, you 'Check-In'.
|
|
|
|
|
Hi
In my application i am trying to send a mail through outlook
.. the problem is when i try to send the outlook first displays a security alert.. Can anybody suggest a way to avoid this warning ???
Thanks
Akhil
|
|
|
|
|
Don't send mail through Outlook.
The reason this security alert was added was to try to limit the spread of email-borne viruses. If you're trying to send email, use the classes from the System.Net.Mail namespace (from .NET 2.0) or System.Web.Mail (any version, but uses CDO rather than an implementation of the SMTP protocol).
|
|
|
|
|
How can i create Setup and Deployment project for an application usingVisual Studio 2005 (Profesional Edition)?
Thanks for consideration.
|
|
|
|
|
Just create a new project. You'll find several project types under "Setup and deployment".
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
when my appliction starts the process comes up and runs
but in case that the process is exited abnormally by program errors or exceptions, the process wouldn't be killed.
so, now i coded like the below..
**************************************
Process[] erssProcess = Process.GetProcessesByName("ERSS.WinUI");
if (erssProcess.Length > 1)
{
MessageBox.Show("The Proccess is running. Please kill the running process first");
return;
}
**************************************
but that's not enough. i like to kill the previous process and run the new process.
i don't know how to distinguish the first process and the second process.
please help~~
|
|
|
|
|
Get the process ID (the number) not the name from the other process and kill it.
|
|
|
|
|
but every time i run the process the process id is changed.
how do i know which one is which?
|
|
|
|
|
Process[] processes = Process.GetProcessesByName(Process.GetCurrentProcess().ProcessName);
foreach(Process p in processes)
{
if(p.Id != Process.GetCurrentProcess().Id)
{
p.Kill();
}
}
|
|
|
|
|
Iam Developing P2p file sharing application using VS2003, I have a list box of all the file names downloaded to my PC, i want to open the file on clicking the filename.
How is it possible?
|
|
|
|
|
System.Diagnostics.Process.Start(@"filepath");
|
|
|
|
|
Thanks a lot,I got the result I wanted.
|
|
|
|
|
hi there
can you please tell me how can i show a message if my app wasn't used for a specific period of time?
i mean how can i determine that my app wasn't used!!?
thanks
-- modified at 21:40 Friday 28th July, 2006
|
|
|
|
|
Use some flags, and set this flag in OnMouseMove or OnKeyDown.
For counting the time you can use timer.
|
|
|
|