|
devzav wrote: And how can I do to make B a "real" subclass?
Inherit from the A class:
class B : A {
...
}
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
I need the "like subclass" I used in the example. So I'll pass a reference to B.
Thank you very much for your answer!
|
|
|
|
|
guys third time posting the question but in vain
i have a table Employee Info in sql 2000
having attributes
EmpID
EmpName
GenID
GenID is a foriegn key of table Gender having attributes GenID and Gender
this.cGender.displaymember = "Gender";
till here every thing is okay
but here the problem arises
the following code is not working why
{this.cGender.valuemember = "GenID";}
i need this code to run bcoz i have to save the value of gender in the Employeeinfo
accoridng to following code
datrow.["EmpID"]= Emp.text;
datrow.["EmpName"]= EmpName.text;
datrow.["GenID"]= cGender.SelectedValue;
sas
|
|
|
|
|
Try writing the code without databinding to get it to work first. It is a good why to identify the exact problem.
Also, without rewriting set a breakpoint on the last line datrow.["GenID"]= cGender.SelectedValue; and examine what is actually in memory.
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
|
Hi,
I've been searching on the internet for an age and haven't found yet found a solution to what looks like a easy problem. I was hoping you guys might be able to help.
Say I have a few web services like
a. service1.add(int num, int num2)
b. service2.subtract(int num, int num2)
and basically i want a generic runner that can call these services. The tricky thing is that one day I might want to add
c. service3.multiply(int num, int num2)
d. service4.divide(int num, int num2)
and I don't want to compile my generic runner again. All the services take the same number of inputs and return the same type of output. Is there any way of doing this.
From what I have read, it seems that the simplist way would be to use MSSOAP, I've managed to connect to an arbitary service, but don't know how you'd go about invoking the methods.
Thanks
|
|
|
|
|
Wii.lliam wrote: generic runner
My first suggestion is "don't make up terminology". In text based communications it is difficult for people to understand what you say.
Wii.lliam wrote: I don't want to compile my generic runner again. project
Using configuration mechanisms to avoid hard coding information into software is not a new concept. There are many ways to do it. One widely used approach today is to use XML files.
Wii.lliam wrote: I've managed to connect to an arbitary service, but don't know how you'd go about invoking the methods.
Again there are many ways to go about that as well and one is WSDL[^]
|
|
|
|
|
Can you somehow use reflection on web services? Perhaps all of your services (like service1, service2, etc. from your example) could export a property that returns a MethodInfo[] will all its methods, and you could call them (add, subtract, multiply, and divide) from that array? Does your main service know that all sub-services implement only those four methods, or could they implement some arbitrary unknown method that you want to export, like say sqrt? If the methods are known, then you could, upon finding a service, make a call to all the possible methods, and the ones that error MAY not be exported by that service, but the ones that work will for sure be available. So, for example, you set up service4, then your mainService would find service4, then make a call to service4.add(1, 1), which would error. Then you make a call to service4.divide(1, 1), which would possibly not error, in which case you would know that method is exported. I'm not familiar with web services, so I'm just throwing out ideas...
Jeff
|
|
|
|
|
Use an object as your parameter: (I typed this quickly but obviously use Properties)
public class Foo{
public string Method;
public int Num1;
public int Num2;
}
[WebMethod]
public void FooBar(Foo foo){}
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
Thanks for the quick reply,
to clear things up, essentially I am trying to do this (I know the coding is wrong, just want to give the idea)
String address="htt://localhost:2299/Service1.asmx" (read from config)
Double num1=2,num2=3(read from config)
Service ser=new Service(address)
Double result=ser.method(num1,num2)
In the past, I can only invoke that service's methods if i add a web reference to it, but this would mean that I need to recompile the main project everytime I add a new service. I would know exactly which service to call and what methods it has.
--------------------------
So far I have managed...
string myURL = "http://localhost:2299/Service1.asmx";
SoapClient sc = new SoapClient();
sc.set_ClientProperty("ServerHTTPRequest",true);
sc.mssoapinit(myURL + "?WSDL","","","");
but again, I don't know how to invoke it's method (or even if it's possible) this way.
Thanks
|
|
|
|
|
I have built different application and I want to put all together as a suite. Any ideas?
a novice
|
|
|
|
|
Ofori Boadu wrote: I have built different application and I want to put all together as a suite. Any ideas?
Add them both to the same setup project.
|
|
|
|
|
Take a look at this article it describes how you could addeach application as a feature in an installer.
"You're very clever, young man, very clever," said the old lady. "But it's turtles all the way down!"
|
|
|
|
|
Oftentimes when applications are allowed into a suite they trash the place and you're left with a rather large repair/cleanup bill.
|
|
|
|
|
Several forms are displayed and each of them contains a plot. Just like the different figures in Matlab. Each them contains one button to edit the figure properties. When I click the edit button on the non-activated form, no reponse from the edit button for the first click! That means I always have to click or actiavate the non-activated form first, then the edit button can response. or I have to click twice the edit button to make it work (only for the first time). Obviously, this is not convenient. How to avoid the this problem?
thanks.
|
|
|
|
|
Why did you reask the same question two minutes later?
|
|
|
|
|
Its the curse of the slow loading times. It goes slow, or times out, so you click post again.
But unknown to you, your post has already made it onto the forum, but the page hadn't loaded on your machine.
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
|
|
|
|
|
If you look close the text is not exactly the same, so he really did post twice.
|
|
|
|
|
I tried for the first time, it said it is too busy and sorry...
then I change a little bit and resend it again..
that is the true!!
|
|
|
|
|
And i beleive you, i've done it myself.
You only ever see this type of double-post when you spot something and change it (i usually see a spelling mistake or something while i wait for it to load, i now must restrain myself, and wait) - otherwise the "you have already posted this message" screen comes up, and blocks your message.
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
|
|
|
|
|
Just an FYI that if it happens to please delete one of the posts.
Thanks!
|
|
|
|
|
Several forms are displayed and each of them contains a plot. Just like the different figures in Matlab. Each them contains one button to edit the figure properties. When I click the edit button on the non-activated form, the no reponse from the edit button for the first click! That means I always have to click or actiavate the non-activated form first, then the edit button can response. Obviously, this is not convenient. How to avoid the this problem?
thanks.
|
|
|
|
|
Are you still having trouble with this?
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Yes!
I can not solve this problem.
I think this is the common problem and I believe there should be the solution, but I can not find it.
I think most people can easily meet this problem once he use more forms and switch the process to different forms. But so far no one give me one solution for this.
thanks.
|
|
|
|
|
Hi.
I have a client for a web service written in C#. It's task is to send some files as SOAP attachments to the web service.
It works fine, but occasionally, if the files are large, the service throws a TimeoutException.
I saw that it is possible to set the timeout value to infinite(default is 15 seconds), thus avoiding the exception.
My question(s): Is it a "bad practice" to do this? I mean, if it solves these kind of problems, why isn't the timeout set to infinite by default? Are there any bad repercussions if I always do this?
Thanks.
|
|
|
|