|
public string varForm1="Form1";
on form2 use value of variable varForm1
string varForm2 = varForm1;
I Love SQL
|
|
|
|
|
The method used depends on the intended use of the variable. If a certain action is to take place each time the variable changes, events are the way to go. However, if the variable is one that only needs to be checked once in a while, then you could use a read only property.
Phil
|
|
|
|
|
I have three buttons which set an integer called retInt in form1. In progam.cs I want to exit the program with return retInt;
Under vis2003 this was not a problem as I just declared static int retInt and it was seen in Main() and form1. Now that Main() is in program.cs and the buttons are in form1() I cannot pass the value of retInt from form1 to program.cs.
Forgive my stupidity but in C++ I would just declare a global variable and be done.
|
|
|
|
|
Sounds like the read only property is the way to go. Look up "Properties" in your help to see how they can be done. If you don't like properties, you could use a public static variable.
Phil
|
|
|
|
|
how i do code when i need a list of layers for each shape in order not to inference the other
|
|
|
|
|
I don't understand the question. What's a layer? What's a shape? Is this some sort of paint program?
More details please.
|
|
|
|
|
Hello,
im writting client/server application. I must create protocol to comunication between it. How it should look?
I thinging about something like that:
Class with data --> serialization --> Compression -->Encryption--> Sending
Receiving -->Decrypting --> Decompression - Deserialization
Is this good idea?
Greetings
|
|
|
|
|
That isn't a protocol. It is a description of dataflow between data transformation processes.
Other than that, it seems fine.
|
|
|
|
|
That architecture is going to take some time to send/receive. Does your serialization have to be compressed and encrypted?
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Yup, it must be compressed and encypted... Data are very sensitive, and there is a lot of it. Getting history for one user - 10k records takes something about 16Mbytes after serialization. When its compressed it takes only 400kbytes. System will be huge - something about 10k users.
Will be two types of clinet:
- which will send data to server, then server store it in database - 99% of users.
- which retrive and analyze data from server - 1% of users
|
|
|
|
|
And don't worry about the details. Also, web services can be configured to be compressed and binary as well.
File Not Found
|
|
|
|
|
class P
{
public void foo1()
{
Console.WriteLine("Inside class AA method foo1");
}
public void foo2()
{
Console.WriteLine("Inside class AA method foo2");
}
}
I can use the methods of this class "P" two way !!!!
1. I can inherit in a derived class like this way
class Q:P
{
}
Q q = new Q();
q.foo1();
q.foo2();
2. I can take an instance of class P in some class and I can expose the object of class P using some property ....
class R
{
P aa = new P();
public P Prop
{
get
{
return this.aa;
}
}
}
R r = new R();
r.Prop.foo1();
r.Prop.foo2();
My question is what is the pros and cons of this kind of method accessing technique!!!
When to use which one ?? Is there any difference between these two ???
Thanks,
Arindam D Tewary
|
|
|
|
|
Hi
I think there's no much difference. It is a type of organizing the code like parent child relation ship. Both method can access the public members. But using inheritance method will give a clear hierarchy of the program.
public class parent
{
//methods
}
public class child:parent
{
//methods
}
I think this will give a clear picture that child having parent properties.
|
|
|
|
|
Dear Navaneethkn,
Thanks for a nice reply. Indeed it was helpful.
Thanks,
Arindam D Tewary
|
|
|
|
|
Well, option 1 means that Q is derived from P. This means that it has access to protected methods in P. Consider the following:
class P
{
protected bool IsValid { get { return ... ; } }
}
class Q : P
{
public void Validate()
{
if (IsValid)
...
}
}
Now, you can't do the same with the following:
class R
{
private P foo = new P();
public void Validate()
{
if (foo.IsValid) ...
}
}
What you are seeing is explained using IsA and HasA relationships. In the case Q, we say that Q is a P - there is an implicit inheritance chain and Q has access to certain *exposed* portions of P. In the case of R, we say that R has a P - no inheritance chain, and no access to the internals of P.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Dear Pete O'Hanlon
Excellent !! I am sure this is what I was looking for .... and the way you have presented is awesome. Thanks a lot !!!!
Thanks,
Arindam D Tewary
|
|
|
|
|
What you use depends on what is logical in the relation between the classes.
Inheritance is used when the objects are basically the same. Like an airline pilot is also a person, so the class AirlinePilot would inherit from the class Person.
Class members are used when one object is a part of or a member of another. An airline pilot is not the same thing as an aeroplane, but rather a part of it, so the AirlinePilot object would be a member of the AeroPlane class.
---
single minded; short sighted; long gone;
|
|
|
|
|
Dear Guffa,
Thanks for a nice reply. Indeed it was very much helpful.
Thanks,
Arindam D Tewary
|
|
|
|
|
My MaintenanceLog table has an entry with following data in a row.
Name: Toney Mirra
ActualDateTime: 2007-02-16 12:55:02.867
PlannedDateTime: 2008-12-05 20:08:57.000
Comments: Sample Entry
But when I run the following query it doesnt return any value.
I think there is some problem in DateTime format. Can anyone help me fixing this?
select Comments from MaintenanceLog where
ActualDateTime = '2/16/2007 12:55:02 PM' and
PlannedDateTime = '12/5/2008 8:08:57 PM'
|
|
|
|
|
sks83 wrote: I think there is some problem in DateTime format. Can anyone help me fixing this?
Well, in general you should use the ISO format because it is culture neutral. YYYY-dd-MMTHH:mm:ss.fff
Your query doesn't work because there is no data that maches. Your ActualDateTime is 867 milliseconds out from what is stored in the database.
|
|
|
|
|
Could anybody help me please? Is there any way to displaying flash animations on C# forms?
jaye
modified on Monday, September 12, 2011 12:05 PM
|
|
|
|
|
www.componentone.com one of the components (C1Flash) can do that
VirtualVoid.NET
|
|
|
|
|
you can host a browser control on your form and then you should be able to load flash in that
Russell
|
|
|
|
|
Hi to All,
I am working on a project in which i have to read data from an Excel file , processing them and write them to another excel file .my codes for reading the data and writing the data in excel are working in diffent application but when i merge them it gives me error
"Unable to cast COM object of type 'Microsoft.Office.Interop.Excel.ApplicationClass' to interface type 'Microsoft.Office.Interop.Excel._Application'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{000208D5-0000-0000-C000-000000000046}' failed due to the following error: An outgoing call cannot be made since the application is dispatching an input-synchronous call. (Exception from HRESULT: 0x8001010D (RPC_E_CANTCALLOUT_ININPUTSYNCCALL))."
help me.
sachin jangir
|
|
|
|
|