|
i want it in c# for my windows application
prashanth,
s/w Engineer,
Syfnosys.
|
|
|
|
|
Try using Math.Round function.
|
|
|
|
|
Hi all,
I am new in C#. and i have been asked to develop a class in which the task is as follows
Electricity bill with in range and also the due date i have to check it out and then only i have to get the amount.
for example if the reading is from 0 to 100 units we have to charge Rs.150, 100 to 200 units amount is Rs.250,200 to 300 units amount is Rs.350 and more than 300 units means amount as 500Rs. and also we have to check the date if it is paid within the date ther is no fine if the is late payment means we have to charge them with 50 rs as fine.
Pls help me guyz itz very urgent .
if anybody has code please send it.
With Regards,
Sakthi
|
|
|
|
|
Sakthi Sat wrote: if anybody has code please send it.
We are not here to do your homework for you, if you want help with a specific problem then ask.
|
|
|
|
|
Hello,
I am writing a code in C#.net which would fire powershell commands. The sample code which I have got from internet uses System.Management.Automation and other such namespaces. Upon browsing some sites I found that I have to reference System.Management.Automation.dll which can be found in GAC however I could not see the same in references dialog from Visual Studio. I removed the dll from GAC using powershell command and placed it to a local directory but still referencing the dll from Visual Studio gives error saying that its not a valid assembly or a COM dll. Please help me and give me some directions on what could be the problem. Below is the environment I am using
Windows Powershell 1.0 (for XP SP2)
Windows XP SP2
.NET Framework 2.0
Visual Studio 2003
Thanks
Abhishek.
Learning is a never ending process of Life.
|
|
|
|
|
abhinarulkar wrote: .NET Framework 2.0
Visual Studio 2003
You cannot create programs for .NET 2.0 using VS2003. You might want to look at the Express editions if you want a free alternative for .NET 2.
|
|
|
|
|
Thanks for that one. I have upgraded to VS 2005 and it works now!!
Learning is a never ending process of Life.
|
|
|
|
|
I've got a couple of kinda dumb questions. What can you expect from someboy whose learning?
1) What is MFC and what do you do with it?
2) While typing code my cursor line goes from a skinny line to a fat blinking rectangle. It also overwrites any previous written code. How do I get back to the skinny line and stop the overwriting?
I figure I may have accidently hit something I shouldn't have. Although I haven't any idea what it was.
Thanks.
|
|
|
|
|
JMOdom wrote: 1) What is MFC and what do you do with it?
Dont you have a book on that topic. I dont want to be rude but you need to read a good basic book about MFC.
JMOdom wrote: 2) While typing code my cursor line goes from a skinny line to a fat blinking rectangle. It also overwrites any previous written code. How do I get back to the skinny line and stop the overwriting?
And even that on windows. BTW find the "Insert" key and press it to toggle the overwrite or insert functionality you are talking about.
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
|
|
|
|
|
well thats ok, not to worry
below are the answers to your questions
1) MFC is Microsoft Foundation Classes. They are a set of classes developed by Microsoft and given to application developers to expedite development. Kind of framework where you do not need to do all the basic stuff, just use the class objects provided in MFC.
2) You must have hit "Insert" on your keyboard just press it once more and it'll be ok. Its toggle button.
Learning is a never ending process of Life.
|
|
|
|
|
Learning is a never ending process of Life.
That's one statement I can't argue with. I expect that the last thing I learn in this life is what it is like to die. (Morbid, Huh?)
|
|
|
|
|
JMOdom wrote: 1) What is MFC and what do you do with it?
Microsoft Foundation Classes.
Back in the 90s, Microsoft wrote a C++ library that wraps the low-level C Windows API.
As far as your second question, coolestCoder answered it. Yeah, that Insert key can be annoying when you accidently hit it.
|
|
|
|
|
MFC is a very good framework to create Windows applications in C++. If you use C# it is completely useless. For study purposes it may be very interesting to read Jeff Prososes book Programming Windows95 with MFC. It gives you a very bright introduction in many concepts that are useful.
If you intend to use c#, you should focus on .NET Unfortunately .NET is so huge that it takes a lot of time to find your way. Don't get frighted by that, because programming is great fun.;)
|
|
|
|
|
Thanks for the answers folks. I'm just now trying to learn C# 2005 at the local junior college. I took a year of Visual Basic 2003 last year there.(They hadn't upgraded to VB2005 at that time.) After I get done with my classes I might try to see about learning C++. If I can manage all that, then I should have a good foundation on computer languages.
I'm also working on AutoLisp to enhance my drafting work. As you can see I've set myself a rather full schedule.
Well thanks again.
|
|
|
|
|
I read some codes, where the conditional statements or rather to say, statements that are not likely to throw exceptions are tried to write out of the try catch blocks. Only statements which can potentially throw exceptions are included in the try catch block.
I want to know why these "other statements" are written out of the try catch blocks ? does exception handling incurs performance / speed loss ? If yes how much loss can be incurred in an enterprise application where we need to catch each and every exception ? Can this (performance loss) be assessed in some way ?
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
|
|
|
|
|
It should be easy right? I want a textbox that looks like the one above where I typed my subject. Are these panels? Or how can you get this look with a textbox?
thanks!! I love this place!
|
|
|
|
|
What do you mean by recessed?
dd314159 wrote: I want a textbox that looks like the one above where I typed my subject.
Theres nothing special that i've noticed , its just a regular textbox!?
In the VS toolbox you have TextBox , the Multiline property by default is false, that what makes the textbox have only one line. If you set it to true then it allows many lines like the textbox where you type you Text while posting something.
A screenshot with hightlights on what your referring to would be great
What version of .NET are you using , and are you talking about windows applications or web applications?
Gideon
|
|
|
|
|
Hi Thanks for the reply. I reread my question and I can see that it was confusing.
What I'm asking is how to get an "inset" textbox - so that it looks like it is below the surface of the windows form - as opposed to appearing flat or appearing raised like a button.
Hope I've expressed my question in an understandable way now. If not I'll send a screen shot.
I'm running .NET 2.0 and I guess I'd like to be able to have inset textboxes on windows forms as well as web forms.
Thanks!
|
|
|
|
|
um well the textbox i'm typing in right now is flat , even the subject box is.
http://gidsfiles.googlepages.com/textbx_flat.jpg[^]
The only styles availiable if visual styles are enabled are in the textBox.Border style properties.
but you could try not calling Application.EnableVisualStyles(); This will get everything to the old win98 style , so everything else has the style.
Gideon
|
|
|
|
|
I am working on a web application project. I am using c# as my programming language and an oracle 10g database.
I am in a situation where I need to read a large text file and Insert it in to an Oracle database.
I have used steamreader and the Oracle's odp.net and was able to successfully insert the text into a table.
Can one of you seasoned developres show me how to do the samething using Microsoft data provider(System.Data.Oracleclient name space)and if possible the streamreader. I appreciate your help.
|
|
|
|
|
I am working on an application that maintains an open connection to an sql database. I also have a timer that checks to see if the connection has closed and if so, it tries to re-opens the connection. This is working fine at the moment as my application and the database are running on the same computer. However this application will eventually run on a different computer to where the database will be. What I would like to know is if for some reason the connection from the computer running the application and the computer with the database were to become disconnected, would my application view this as the connection being closed?
|
|
|
|
|
Darkness84 wrote: I am working on an application that maintains an open connection to an sql database
First of all, I would like to know the conditions under which you need an open connection to the database (always) ?
I think you can open the connection just at the time of your query execution. what is the problem in this kind of scenario ?
Persisting database connections will load your database server. I dont think that this is desirable.
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
|
|
|
|
|
I am using SqlDependency so that my application will respond immediately to changes in the database and thus i need the connection to be open.
|
|
|
|
|
Hi,
I dont know much about the SqlDependency, here[^] is an article on CP, which specifies (at the last) that the connection need not be open to recieve change event. Will this solve your problem ?
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
|
|
|
|
|
Not sure, but I'll have a read. Thanks.
|
|
|
|