|
Why take an int? What happens if you get null passed in ? You don't check for it.
What is going wrong right now ? It's hard to 'find a solution' if you don't tell us what the problem is. I can see why this probably can never work, your for loop can't possibly return any thing but a, ab, abc, etc. I would expect to use a while loop and a stringbuilder to build a string based on the values I kept subtracting from the core number until I got to 0.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
ok I'll try and add a StringBuilder to this. I spent a day on it and the solution was not cliquing. I think I'll just get out an algorithms book and start from square one.
Thanks,
Marc
Life is too short to program in Visual Basic.
|
|
|
|
|
I think your best bet is to set a breakpoint and step through and see what your code is doing, so you can see where it's deviating from your intentions.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
I have a .dll with its own config file. This .dll reads from its own config file and not from the app.config (this is what I wanted). However, when I create the installer for the application, the .exe uses the app.config file to read from, but what about the .dll? Where is the config file for the .dll stored? It is getting the values but I am curious where it is getting it from? The app is working fine but I want to change the config file for the .dll but I cannot find it.
CodingYoshi
Visual Basic is for basic people, C# is for sharp people. Farid Tarin '07
|
|
|
|
|
Have you looked for the settings in the apps config file ? If you don't have a config file for the dll ( I always do ), then it's either using defaults, or getting them from the app config.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
CodingYoshi wrote: I have a .dll with its own config file.
No you don't. .DLL's do not use their own config file, even if you put on in the DLL's project. .DLL's are loaded into the processes that call them, inheriting the host process' config file, if there is one.
Your code has to be explicitly written to find and load the config file your talking about. Config files are normally stored in the same folder as the .EXE using it.
|
|
|
|
|
Strange!! Then it should cause an exception since config setting are key value pairs. I have specified the key of the value in .dll code. The only other thing is, tomorrow, I have to reassure and see if a value with the same key exists in the app.config which will explain why no exception is thrown. Otherwise, I don't know.
I agree with you, .dlls can have their own config files but they have to be read explicitly and I am reading it explicitly but I will reassure.
CodingYoshi
Visual Basic is for basic people, C# is for sharp people. Farid Tarin '07
|
|
|
|
|
I reassured and the .dll is using its own config file. I am using [NameOfDll].Properties.Settings.Default.[keyOfValue] to access the value from the config file. I changed the config file for the .dll and during runtime it threw exception since it could not find it.
So the question is, where is it reading from? I don't see a config file for the .dll on the production machine but all is fine.
CodingYoshi
Visual Basic is for basic people, C# is for sharp people. Farid Tarin '07
|
|
|
|
|
In my code, I use a static method of a class. For example, class name is ABC. The static method name is GetService().
I called the ABC.GetService() twice. The first time it returns null, because the ABC service is not available at that time.
However when I call the method the second time, it should return the service, because the service is available already. but the code still retunrs null. If I put a break point before the second time I call the function. I can use code to see the ABC.GetService() returns the service.
It seems to me that the code remember the previous result and used it again when it should not.
Is there a way to resolve this issue.
Any suggestions are greatly appreicated.
Best Regards
Bin
|
|
|
|
|
I suspect your code is broken. The best way to write code like this, is to make your static property check if the return value is null, and if it is, try to populate it, before returning it. Obviously, if you want us to tell us what's wrong with your code, you need to post it.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Thank you very much for your reply.
The first time when the function is called. The value is supposed to be null. I don't want to populate the value at that time.
I cannot post the code here. It is a very big project. The service is SharePoint shared service. In the beginning, the service is not available. I ran psconfig.exe to create the shared service. I will try to repro this with some simple example.
Thank you very much
Bin
|
|
|
|
|
You can't post the code to a property ?
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
If you get a different result running and stepping through some program code, I always suspect either a timing issue that depends on external stuff or the optimizer settings when you compile.
As to why there's a problem, as mentioned, without code who knows.
CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
I am programatically trying to submit a form in an html page that consists of multiple forms. This page is not an asp.net page and i do not have control to change the content. How do i submit a specific form using HttpWebRequest object?
Here is a sample html: (note: second form has not id attribute)
<form id="form1" action="someurl.com" method="post">
<input type="hidden" name="abc" value="firstForm">
<input type="submit" value="firstForm" />
</form>
<form action="someurl.com" method="post">
<input type="hidden" name="abc" value="secondForm">
<input type="submit" value="secondForm" />
</form>
Thanks in advance!
|
|
|
|
|
Greetings,
I need to plot a 3D chart using 3 axis – x, y, and z. It is done in C# .NET environment. Was trying to enclose a mockup for illustration purposes without succes to this message, would be seny by mail if needed.
I have been trying to use MsChart. I manage to render a 2D chart (x,y axis) but I am unable to render 3D with three axis. If you know of a way to control the data point’s color that would be of much needed help too, although it is secondary to the rendering challenge.
I would appreciate your assistance in pointing me to resources, references, or post the correct code to render a 3D graph.
Many thanks,
Amir.
|
|
|
|
|
there is one book including both 2d and 3D charts!
|
|
|
|
|
Do you have it's name?
thanks.
|
|
|
|
|
There is definitely at least one free charting library that does 3D, but you'd have to google, I don't have the name.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Practical C# Charts and Graphics
|
|
|
|
|
many thanks. Hope it will do any good.
|
|
|
|
|
What is the current feeling about the use of databound controls? When I first started using a RAD framework I remember many people on the message boards that I belonged to were very much against the use of databound controls.
IMO they greatly speed up development - but are they considered a good practice in the industry?
|
|
|
|
|
I can't imagine why anyone would be against a data bound control. What was the reasoning ?
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
I think what he means is the early binding learnt by most newbies from the MS tutorials which I think stink. OTOH manually populating controls is just stupid.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
My apologies, my memories of the arguments are poor. This was back in the day when I was using Borland Builder. I seem to recall that many of the people on their news groups thought that the use of databound was evil. I even worked for a man who used Delphi who refused to allow his staff to use databound controls. I have always used them, because IMO, it is part of the point of using a RAD tool - and I am using them heavily now. But I was curious what the industry's view is.
|
|
|
|
|
I am setting the data source of a combo box in the form constructor. the problem is that when the page is loaded and the data is being loaded in a combo box the selectedindexchanged event is being triggered. i don't want that to happen. how can I tackle that problem please?
Thanks for the help
|
|
|
|