|
Hi,
Sorry to tell you that, i am not getting what you are trying to achive appart from some class relation.
namespace CS<br />
{<br />
class Program<br />
{<br />
static void Main(string[] args)<br />
{<br />
B Obj = new B();<br />
List<A> _list =Obj.GetList();<br />
}<br />
}<br />
class A<br />
{<br />
protected int Age=0;<br />
public A() { }<br />
public A(int age)<br />
{<br />
this.Age = age;<br />
}<br />
}<br />
class B : A<br />
{<br />
<br />
public List<A> GetList()<br />
{<br />
List<A> GList = new List<A>();<br />
GList.Add(new A(21));<br />
GList.Add(new A(22));<br />
GList.Add(new A(23));<br />
return GList;<br />
<br />
}<br />
}<br />
}
Presumably, the above lines of code will give an idea on the route map.
If the post/article served your purpose then, please assist me in keeping it up by donating a small amount of money to my Paypal account. Email: sreejithssnair@hotmail.com
|
|
|
|
|
leave it assume i want to to the following
def_voucher is derived from abc_voucher
but it says that cant convert type of abc_voucher t0 def_coucher ,,
why ?
though def_voucher is derived from abc_voucher ..
public function abc as abc_voucher
dim vc as new def_voucher ();
return vc;
end function
-- modified at 4:06 Thursday 29th November, 2007
hello
|
|
|
|
|
ghumman63 wrote: but it says that cant convert type of abc_voucher t0 def_coucher
That's because you can't upcast, only downcast.
So while you can add a def_voucher object to a collection of abc_voucher s, you can only interpret the contents of the list as abc_voucher objects.
/ravi
|
|
|
|
|
That's because inheritance is a form of specialization of abstractions. Student is a special form of Person etc. You cannot specialize something general, but you can generalize something specialized.
This is analogous to saying "Every Student is a Person" [Generalization] But you cannot say that "Every Person is a Student"
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook
"There is no wealth like knowledge, no poverty like ignorance." Ali ibn Abi Talib
"Animadvertistine, ubicumque stes, fumum recta in faciem ferri?"
|
|
|
|
|
i am sorry i cant get,
when i do the following
function abc as ilist
dim xyz as new list(of def_coucher)
return xyx
end function
here it works fine , why ?
the same i am doing in my previous case ..
thanks in advance
hello
|
|
|
|
|
Hi,
I have to read too many data from a web site using SOAP. For that I create a button and read the data.
I have to read the data in background (Automatically) which option is better...?
I use timer say after every 15 min that makes my app slower.
I also use background worker but it will give cross threading error because I have to update the content of the win form.
And one big issue is their are too many problems to connect with the web site like server unreachable, Connection failed, Invalid query, too big response from SOAP etc.... So I also have to handle that, So how can I resolve this..? please help me...
Regards
Pankaj Joshi
If you want to shape your dreams into reality, please wake-up...
|
|
|
|
|
Pankaj - Joshi wrote: I also use background worker but it will give cross threading error because I have to update the content of the win form.
Not if you implement it correctly. See this[^] article.
/ravi
|
|
|
|
|
Thanks for your reply any more suggestions...?
And I'm surprised the link is not opening properly in Mozilla...
Regards
Pankaj Joshi
If you want to shape your dreams into reality, please wake-up...
|
|
|
|
|
Pankaj - Joshi wrote: I'm surprised the link is not opening properly in Mozilla...
Here's the vanilla[^] version of the link.
/ravi
|
|
|
|
|
Any other idea to get big data over the web in batches...?
Regards
Pankaj Joshi
If you want to shape your dreams into reality, please wake-up...
|
|
|
|
|
Hi,
I am writing a Pocket-PC application in C#. This application requires data synchronisation, so I thought... nothing easier than that.. and developed a webservice.
But then, I thought it would be very nice to give the user a visual feedback what the pocket-pc application is actually doing... and I thought about a progressbar to display the progress of the synchronisation process.
so far so good....
I wrote a SoapExtension for my webservice and tested it in a win-form application.. works great BUT
i have to provide a little snippet to my app.config file like:
< system.web >
< webServices >
< soapExtensionTypes>
< add type="TimeSheetApplication_FORM_test.ProgressExtension, TimeSheetApplication_FORM_test" priority="1" group="0" / >
< /soapExtensionTypes >
< /webServices >
< /system.web >
but a pocket-pc application doesnt have an app.config. okay, fair enough I thought..
I wanna get this soapextension-sh*t into its own project anyway. So I created a new class project and moved the soap-extension over.
but then I got the following errormessage when compiling:
The type 'System.Web.Services.Protocols.SoapHttpClientProtocol' is defined
in an assembly that is not referenced. You must add a reference to assembly
'System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.......
....
The system.web.services assembly is already referenced in both project.....
has anybody consumed a webservice on a pocket-pc application via soapextension yet? and if yes, how did you tell the pocket-pc application to use the soapextension without providing this information in the app.config?
any help or suggestions are very appreciated!!!!
cheers
piratenwichtl
|
|
|
|
|
hi guys,
the solution is to create a class which is inheriting from SoapExtensionAttribute.
After that you set a attribute on top of the method you are calling the webservice and suddenly your soapextension gets invoked as well.
easy - if you know it
cheers
piratenwichtl
-- modified at 19:59 Thursday 29th November, 2007
|
|
|
|
|
Alright, well i am working on a desktop application. I am trying to figure out how to create child nodes under the root. I have tried almost everything, and the closest i get to the solution is creating a child node that looks like this:
<Root>
<whatever name="something />
</Root>
when in fact i want
<Root>
<whatever name="something>
</whatever>
</Root>
Also, how can i place more child nodes under another child node once created?
Thank You
|
|
|
|
|
These 2 XML fragments are functionally equivalent:
<whatever name="something" />
<whatever name="something"></whatever>
If you want to add inner text to the <whatever> element, do this:
XmlNode whateverEle = ...;
whateverEle.InnerText = "some text";
/ravi
|
|
|
|
|
Is there a way for me to pass multiple variables in a constructor with a single variable, why because I will be repeating this process many time. Also have a definition for the constructor variables. See the following example:
PassVariables = {a, b, c)
ConstructorVariables = {this.A a, this.B b, this.C c)
Thanks in advance,
Michael
-- modified at 22:01 Wednesday 28th November, 2007
|
|
|
|
|
You could have all of the variables you want to pass inside an object that you pass through the constructor. There are many ways this can be done.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
In addition to what Paul said, you can also pass in an array:
class Foo
{
Foo(string[] variables)
{
this.A = variables[0];
this.B = variables[1];
...
}
}
|
|
|
|
|
You can pass this values as parameters to the constructor also
<br />
public class Foo{<br />
string a1, b1;<br />
Foo(string A, string B){<br />
a1=A;<br />
b1=B;<br />
}<br />
}<br />
Hope this helps.
Maharishi
Nothing is Impossible. Even impossible spells "i m possible"
|
|
|
|
|
Hi Everyone
is there any way to create/edit the ID3 tag of MP3 thru a C# application.
Cheers
Bino
www.codepal.co.in
|
|
|
|
|
There's at least one class in C# on this site for editing MP3 tags. V1 tags are just appended to the mp3, v2 tags are compressed.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Bino B wrote: is there any way to create/edit the ID3 tag of MP3 thru a C# application.
Yes[^].
/ravi
|
|
|
|
|
Hi All,
I want to go another round with C# and its Visual personality. I found a Stéphane Rodriguez's templates [1,2]. The next step is the 'Toolbox' architecture.
Are then any boiler plate solutions available for a drag and drop toolbox full of widegets? This would be very similar (if not exact) to Visual Studio's Toolbox.
Jeff
[1] C# SDI/MDI Application Wizards[^]
[2] C# SDI/MDI Application Wizards[^]
|
|
|
|
|
Prior to spending the last eight months using C#, life was good in the land of C++. I could use pointers without explicitly sharing that fact with the compiler. Implementing a Bus class that inherits from both GroundVehicle and PublicTransport was a non-issue. And of course, I could declare a method with thirty-two overloads in one definition using default parameters. The latest headache that I have encountered in C# is the removal of the ever useful typedef. Why is it that a new language, birthed from a great language like C++, would restrict its users by removing some of the most usefull features of the language? Did the designers of C# feel that code reuse is better left in the past because programming was becoming too convenient?
Why is it that now, during the code design phase of an application, when I don't know whether I will be using an int, string, long, etc. for a unique identifier, can I not either
(1) typedef a class "UniqueIdentifier" to int for now, so it can easily be changed EVERYWHERE later, or
(2) create a class "UniqueIdentifier" that inherits from int, which would essentially typedef it as in (1)?
Instead I have to guess which one I will end up using, then go through my code line by line in two months and find every single occurance of that type, then change it to whatever it should be. The only other alternative is to REIMPLEMENT the int class, which is a complete waste of my time. This lack of convenience perplexes and frustrates me to no end. I am also disappointed that an interface member who returns void (nothing) cannot be implemented by a method that returns some other type. Oh well, I guess that I will have to start implementing my own compiler so I don't have to put up with the lack of thought and foresight by the "greatest minds" in our field.
Jeff
|
|
|
|
|
To set in your ways with C++ eh?
They are different languages, they both have their strengths and weaknesses.
As for C# i actually find it quite good, and multiple inheritance, well, what can i say. A little actually, i don't wish it was there, it can be a bit of a hack some... alot of the time. You just have to use a different method than your used to, to acheive what you want.
My current favourite word is: PIE!
I have changed my name to my regular internet alias. But don't let the 'Genius' part fool you, you don't know what 'SK' stands for.
-The Undefeated
|
|
|
|
|
Multiple inheritance rocks. It's not the compilers fault if some peope who mis-use it are morons.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|