.NET Getting The Now Property Cost?
Jul 5, 2011Useless question I guess, but accessing the property DateAndTime.Now computes each time the current system date and time, I suppose, is that right?
[Code]...
Useless question I guess, but accessing the property DateAndTime.Now computes each time the current system date and time, I suppose, is that right?
[Code]...
I am running into trouble with some code I am doing for an assignment. The section within the apostrophes (If Then Else) is the section that I am having trouble with. When the user selects a seat type and then clicks the compute button, the wrong cost is displayed instead of an accurate cost.
Option Strict On
Public Class frmTickets
Private Sub btnComputeCost_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnComputeCost.Click
Dim intNumberOfTickets As Integer
[CODE]....................
How do I code the total cost to give me a pound sign with the total cost at the moment when the total comes up for an example it gives me 3.6 when I need it to show £3.60 here is the code I have so far. [code]
View 2 Replies(1) I've read a lot of questions about IDisposable where the answers recommend not using Finalize unless you really need to because of the process time involved.What I haven't seen is how much this cost is and how often it's paid. Every millisecond? second? hour, day etc.
(2) Also, it seems to me that Finalize is handy when its not always known if an object can be disposed. For instance, the framework font class. A control can't dispose of it because it doesn't know if the font is shared. The font is usually created at design time so the user won't know to dispose it, therefore finalize kicks in to finally get rid of it when there are no references left. Is that a correct impression?
I need to know basic compiter skills,abbreviations ,what is aC++ and so oncan I get that here or would I be better off at a Technical school?
View 2 Repliesbelow is the code I am working on. It is for a hospital cost form.
[code..]
I have a working version, but it doesn't meet the requirements completley.(I can post that if you need to see it) I am redoing this project and I am so stressed out. I may be overlooking something!
[code..]
I am trying to calculate a total cost from an elapsed time. Dependant on how long the time is, this will calculate the total cost. It has to be 3 to every hour. The elapsed time is displayed in label6 in "hh:MM:ss" format and the total cost needs to be displayed in label8.
View 4 RepliesI am creating a code for a school project that calculates the shipping cost for a package. In this program the user enters the weight of the package ( in pounds ) and selects the destination of the package. The application with determine the cost of the shipping. The destination of the package can be the US continental, Hawaii or Alaska. If the package is going to Hawaii a 20% surcharge is added to the shipping cost. If the package is going to Alaska, a 26% surcharge is added the shipping cost.
This is my code thus far. When applying my weight in pounds and selecting the destination I still keep getting 0.0 for the total.
Public Class Form1
Private Sub textboxpounds_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles textboxpounds.TextChanged
End Sub
Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)[Code] .....
Here is a screenshot of the GUI
Uploaded with ImageShack.us
Our company has relied heavily on COM+ components to centralize our DAL code and take advantage of the ability of COM+ to handle transactions and connection pooling. When we started using COM+, it was just with VB6 DLLs and always through late-binding so we could take advantage of DLLs being hosted on a different server.When we started moving to .NET in 2005, we ported our DAL functionality to .NET and continued to use COM+ and late binding to host the components. We would instantiate the objects like so: objBalLauncher = CreateObject("NETBLL.Launcher", "\" &strCOMPlusServer Name)I noticed that CreateObject seems to be for ActiveX COM components, so this has me thinking about two things:If COM+ was designed for unmanaged components, is there a cost to using COM+ with managed .NET DLLs?Is there a cost to using CreateObject() to late-bind to an assembly from within .NET code? Does this force your code to cross the managed/unmanaged barrier to communicate with the DLL? While I would be interested in hearing about alternatives to COM+ (which I'm sure are available by now), I'm most interested in hearing about what expense I incur from using managed DLLs within COM+.
View 1 RepliesI'm have successfully did a shortcut "+" and "-" button to increase and decrease the qty ordered. But by doing so, i now have problem tabulating the cost for each item. Below is the print screen for my application. You will realised that the Lamb tandoori which is going for $3 cost only $21 after increasing the quantity ordered using the "+" button.In addition, i have created different list boxes for different food categories.Each category's food items is selling at the same price.
<img src "http://img521.imageshack.us/img521/6144/prob.png" />
When i run the program and click the cost button, it only returns a value of £0.00 for insurance cost and total cost.
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCost.Click
Dim Cost As Double
[Code]......
My project, is something that could be used by an opticians (well in theory anyway)I have a customer being selected, eye measurements etc..Then I can enter in data (into textboxes):
TextBox1. Frames Stock: #12345
TextBox2. Material Used: Glass / Plastic
TextBox3. UV Filter: Yes / No
[code].....
I was trying to make a calculator which takes the amont of copies you want to make and it tells you the cost. Then you type in the amount you want to enter and if its less a message box comes up saying "please enter more money". I've had a few problems
1. when i use formatcurrency the program crashes for no apparent reason
2. if i calculate cost without entering any copies then it crashes (ive tried putting a msgbox in but it crashes anyway)
3. if i get the msgbox to come up saying "Please enter more money" i had to remove the formatcorrency tag.
I have a class assignment where i have to calculate the total cost of a parking garage from hours but i have to do it with a method function. So this might be a stupid question but can you read the user input values from a textbox in the function itself or do they have to be read in and recalled from the Private Sub Button1_Click section?
View 8 RepliesI have a assignment and I have got to do the total cost and put the total in a label, here is the code. Select Case pizza1
[Code]...
Create an application that calculates the total cost of a stay in a hotel in the North Carolina mountains. The application should accept the following in terms of input:Month of Check in Length of Stay (in Nights) Number of Persons Room Service Charges Phone Charges Other Charges If the check in occurs in November-March the rate is $89/night. April-August is $99/night and September-October is $109/night. $10/night should be added if more than 2 people are in the room. More than 4 people are not allowed in the room, and a traveler can only request 1 room. A 15% tax should be added to the room rate and 10% tax added to all room service and other charges. No tax will be added for phone charges.
The program should use a function to calculate the total charges for the visitor's stay and output it to a label. There should be buttons or menus to calculate the total, clear the form, and exit the application.At least one of the button should call a sub procedure which performs its function. I don't understand how to set this program up and I'm not sure what it means.
I certainly hope I don't aggravate you with what is certainly a very simple code problem. I have never programmed before, but I do have a background in tech support, etc. I have an assignment to do and it's frustrating to wade through the information out there to find exactly what I need and nothing more.The assignment has 3 parts, one of which i've done. We are to do the same function in both javascript and VB. I was able to take a sample we did in class that caluclates a 10% discount and modify it so it calculates the total. Now, I have to modify that into a VB sln file. then write about the differences but that part will be cake.
I am working in Visual Studio 2008 - that program is new to me as well. When I created my login and it asked what VB I'm using, I did not know but under theu of VS, it says VB 2008.hat I attempted to do was to take the instructor's sample discount code and modify it for the new purpose, but an error was generated. This is the sample code I started with:
'Programmer: Dan Dougherty
'Date: Feb 2010
'
[code].....
How to update the total cost after every item is selected and the user clicks enter...
Private Sub calcbutton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles calcbutton.Click
Dim amount As Double
Double.TryParse(amounttextbox.Text, amount)
Dim total As Double
[Code] .....
I'm trying to calculate the total cost for gas for a Chevy and a Buick on a form. The total miles is 21 for city and 33 for freeway. I'm also putting in the mpg for each, for city and freeway. How would I set up the labels to display the right amount? Do I use If Then statements?
View 9 RepliesI am having a problem linking the two other mods. I can't seem to be able to link CalcMiscCharges and CalcTotalCharges. I realize that I have just the CalcDayCharge being displayed. I am not getting any kind of errors, as of now.
Public Class frmHospitalStay
'Clears the form.
Private Sub btnClearForm_Click(ByVal sender As System.Object, ByVal e As
[CODE]...
I'm using FedEx for my shipment and use the FedEx rate calculator to find the shipping cost. When I send the request and get back the response, I always find that there is no discount applied even if i send a quantity of 100. following questions so that i can get clear with how to work with the fedex webservice
1. If i want to send 2 quantities of a product. will i be constructing the request with a package count as 2 and repeating the same <requestedpackage> twice ?
[Code]...
I have a class project that I have been working on for a while, and I can't figure out how to add each cost from lstCosts together to show a total cost of the selected workshops in lblTotalCost. Using the current loop that I have, it only adds the last cost in lstCosts. Is there a way to add the indexes together?
Code:
Public Class Form1
' The registration fee for each workshop
Const intSTRESS As Integer = 595 ' handling stress
Const intMANAGEMENT As Integer = 695 ' time management
Const intSKILLS As Integer = 995 ' supervision skills
[Code] .....
For our programming assignment to end the module (which im really struggling with) we have to write some code for use in a fictional taxi firm that charges �2 for the first mile, one price for miles 2-10, and another for all miles thereafter.
View 11 RepliesCreate an application that calculates the total cost of a stay in a hotel If the check in occurs in November-March the rate is $89/night. April-August is $99/night and September-October is $109/night. $10/night should be added if more than 2 people are in the room. More than 4 people are not allowed in the room, and a traveler can only request 1 room. A 15% tax should be added to the room rate and 10% tax added to all room service and other charges. No tax will be added for phone charges.
The program should use a function to calculate the total charges for the visitor's stay and output it to a label. There should be buttons or menus to calculate the total, clear the form, and exit the application. At least one of the button should call a sub procedure which performs its function. [Code]
I have a combo box, I have entered in 6 different world wide destinations for example:London, Paris, New York etc The program is for booking plane tickets, at the moment the user has to input the cost of the journey manually into a textbox and then depending on the number of tickets requested will calculate the cost.
What I would like to do is to assign a unique numeric value (the specific cost of the flight for one ticket) to each of the items in the combo box list so that when a user selects a destination the default cost of the ticket is already known and does not require the input of the user.Private Sub cmbDestination_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmbDestination.SelectedIndexChanged End Sub The idea is that which ever destination is selected, for example: Paris - �155 would then set the variable 'ticketPrice' to 155 and allow me to change the calculations of the program to not require user input.
How would i get this to work on a listview to count the total in the header colums called Cost.
This is a code for DataGridView how do i get it to work in listview?.
code
Dim index As Integer = 1 'column index
Dim total As Single = 0.0F
[Code].....
how to setup POP3 access that DOES NOT cost money! I have a program that needs to receive email.I have looked ALL over the internet for examples and have come up with NOTHING! Maybe it's about time we all pull together and finally put a solution out here for how to do it. I know it's not THAT complicated because I am a novice as is my roommate and we had an email program about 4 years ago and it wasn't that complicated then, so I don't imagine it is, however, I did not save that email program that we built so I can not refer to the coding again!
View 3 RepliesI'm having some very weird issues with interfaces right now.
I have a very simple setup. In one of my class, I have a Property implementing a Property from an Interface.
In my class it's like:
Private _oForm As IForm
Public Property Form As IForm Implements IContainer.Form
Set(value As IForm)
[Code]...
I have like dozens of interfaces like this working throughout my project and I can't believe this simple one can't work!
I am making a program which calculates the cost of (Let's say) Spent Electric Energy for a number of days,defined by the user..I have 2 Date Time Picker and x (The average energy spent in a day) where x must be an integer and it is defined by the user x * (DateTimePicker2.Value - DateTime Picker1.Value) = y (The value to be paid for a number of days)
View 4 RepliesI was wondering if someone could translate this code into a more understandable code. It is suppose to be a function that accepts an item name its cost and its quantity. and adds one more array element to ."items" variable and assigns the given name and cost and quantity.
Public Sub AddItem(ByVal strName As String, ByVal dblCost As Double, ByVal intQuantity As Integer)
Me.items=DirectCast(Utils.CopyArray(DirectCast(Me.items,Array),New Purchase(me.itemsCount + 1)-1){}),Purchase())
End Sub
This is the translation i made but i don't think it is correct.
Public Sub AddItem(ByVal strName As String, ByVal dblPrice As Double, ByVal intQuan As Integer)
Dim items As Purchase() = Me.items
Dim itemCount As Integer = Me.itemsCount
For itemCount = 0 To items.Length - 1
[CODE]...