Project Clean-Up - Errors Occur When Someone Doesn't Pick A Value
Oct 21, 2009
today I finished my VB project which is a program that generates costs of pizza's by what the customer order. The code is all complete just looking for some idea's on to stop bugs and clean up the code. So below is all my code and picture of the form. Errors occur when someone doesn't pick a value, so what i want is there to be default values as 0.
[Code]...
View 1 Replies
ADVERTISEMENT
Apr 11, 2011
When I publish the program. Is there any way to get VB to publish the text files with the program so that no errors can occur. When I install and run the published program I get a series of errors relating to text files that are not found.
View 4 Replies
Apr 16, 2012
The user has been running the app in question for over a year with no issues like this (this is a VB2008 business/database application with an executable 4.6 MB in size). Starting last week, "all of a sudden", the user started getting INTERMITTENT error messages like the following:
Exception has been thrown by the target of an invocation.
Creation of the ImageList handle did not succeed.
Out of memory.
Parameter is not valid.
The last two have been accompanied by the big "red cross" on the form (in the screen shots the user sent me).The fact that the one message mentions "ImageList" and poking around on the Internet for answer on "Parameter not valid" points in the direction of a graphic problem, but nothing has changed in this area for a long time, and the app only uses graphics in a very straightforward way, using images on buttons and menu items, but not doing any in-line graphics methods.
View 1 Replies
Jul 6, 2010
Private Sub cmbEmployee_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles cmbEmployee.Validating
[code]...
View 2 Replies
Aug 24, 2011
I was under the impression that a node can be anything at all, be it element, attribute, etc etc.I was looking at trying to iterate through a node list, eg ....
Dim xmlDoc As New Xml.XmlDocument
xmlDoc.LoadXml("
< main1 test1 = 'any' test2 = 'any2' >
[code]....
Why does the following return only the elements, and not the attributes:
For Each objnode As Xml.XmlNode In xmlDoc.DocumentElement.ChildNodes
Console.WriteLine(objnode.Name)
Next
How can I iterate through all nodes, regardless of type, using xpath?
View 1 Replies
Sep 16, 2011
I have written a small program to aide my business and the program works fine. But while compiling the code it shows a lot of warnings like the following."late bound resolution; run time errors may occur""implicit conversion from 'Object' to 'String'." Where am i going wrong. Even though the options strict off removes the warning I want to correct the warnings.
Private Function ledgerMasterFullName(ByVal i As Integer) As String
Dim fullName As String
Dim vObj As Object
[code]....
View 4 Replies
Sep 9, 2009
I am making this program for a school assignment but it has errors when calculating
Private Sub frmReceipt_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'When this form is loaded, assign the date to the date label & start the timer
lblDate.Text = Date.Now
[CODE]...
So if counter finishes, execute the following code
If counter > 4 And km >= 1 And kmcashset = 0 Then 'If there is still kms to calculate 'And kmcashset = 0
kmcashholder = kmcash
km = km / 5
[CODE]...
And if I add counter = 0 and km = 0 at the end of that "If counter > 4 And km >= 1 And kmcashset = 0" Then it doesn't calculate anything correctly. I supply it with 9 for Distance and it returns 4 for excessdistance which is correct but returns 7 for excessdistancecharge when it should be 4! When I supply 23 for Distance it returns 18 for excessdistance and 11 for excess distance charge which is correct. (???)
Excessweightcharge calculates correctly.
I think it may be the way I'm implementing it, through the use of AND or maybe it's because it's in timer tick?
-Minimum charge of $5 which covers 10 kgs for the first 5 kms only
-Each kg over 10 kgs incurs a charge of $0.50
-Distances over 5 kms incur an additional charge of $1 per km up to 10 kms
-For deliveries over 10 kms, the extra distance should be rounded up to the nearest 5 kms and charged at $2 for each extra 5 km block.
EXAMPLE 1:
Packet weighing 9kms travelling 9 kms
Standard charge for first 5 kms ($5.00)
Weight less than 10 kgs so no extra weight charge
Extra distance charge 9 - 5 kms = 4kms x $1 = ($4)
Total delivery charge = $5 plus $4 = $9
[But my program returns 7 for excess distance charge]
EXAMPLE 2:
Packet weighing 33kgs travelling 23 kms
Standard charge for the first 5 kms ($5)
Excess weight 33 - 10 kgs = 23kgs x $0.50 ($11.50)
Extra distance (23 - 5kms = 18kms):
18kms ( 5 to 10 kms at $1/km) = ($5)
13kms (18-5)/5 = 3 (rounded up) x $2.00 = ($6)
$5 + $6 = $11
Total delivery charge = $5 plus $11.50 plus $11 = $27.50
[My program calculates everything correctly]
View 2 Replies
Jan 6, 2012
End A statement which as far as i know doesn't close you program properly and hides errors. Right now i'm being forced to use end because i don't know how else to close my program properly. I'm not sure where my problem is but some of you should be able to fix it. I'm trying to make a game using directx with a game loop. This code is the skeleton of what i'm making.
Public Class Form1
Private ProgRunning As Boolean = True
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Me.Load
Me.Show() 'Make the form appear
Me.Focus() 'Give the form focus
[CODE]...
This code runs alright because end is being used but if you rem end out the error which it's hiding comes out. The error is "Object reference not set to an instance of an object." I'm not totally sure but i'm guessing that the error is refering to the form.
View 9 Replies
Apr 14, 2010
I am using Synclock to prevent multiple threads from logging text messages to the same file at the same time, but this doesn't seem to work:I get frequent sharing errors on the logfile, within the synclock block.The Synclock is using the variable holding the filename, because it exists all the time and because it is always the same object, whatever class instance or thread I'm in.[code]Despite using Synclock and a Using block around the code, I keep getting this error in the sw.WriteLine(Msg) line:System.IO.IOException: The process cannot access the file '(filename)' because it is being used by another process.Should I use some other type of object than a string to synchronize on?I cannot use a user interface object (button or so) because it is a windows service project.It was written and compiled in Visual Studio 2008, but targeting the 2.0 framework because it has to be able to run on some old Win2000 machines.
View 12 Replies
Jan 10, 2012
I have a VB .dll from a previous developer that I need to modify. So I de-compiled it with no errors and then exported the code. I tried to compile the project and get two syntax errors:
New SqlDataAdapter(query, Me.connection).Fill(dataTable)
New SqlDataAdapter(DirectCast(command, SqlCommand)).Fill(dataTable)
The error message just says syntax error, nothing else.
View 3 Replies
Jul 8, 2011
I have a problem with one of my projects that has only just started occuring this morning.I am using VS 2010.I get errors on every form that has a VS generated dataset, similar to;
me.<dataset> = new <namespace>.<dataset>()
and
with events <dataset> as <namespace>.<tableadapters>.<tableadapter>
[code].....
View 2 Replies
Mar 2, 2012
A need came up for me to work on a program that resides on a web server. I can't pull up the code and I get these errors:
[Code]....
In addition, you must run Visual Studio in the context of an administrator account. I have never worked on anything like this before and for right now I would just like to look at the code. I Googled and found this: You can enable these features in the Add/Remove Programs control panel. In there you wiull find a link off on the left labeled something like 'Turn Windows features on or off'. Click that and you'll get a UI for managing the IIS features that are installed.
I looked there and don't have a clue what I should check. I'm on Windows 7. What should my approach be? I don't want to just clicking things in the IIS configuration console. The attachment is what I see.
View 3 Replies
Jun 24, 2009
I'm not sure what happened. I saved my project last night and everything was in working order. I opened it this morning and it's not recognizing a lot of the System methods and functions
MsgBox
Format
FormatCurrency
InputBox
Even the constants like vbTab and vbCrLf aren't appearing. Any suggestions on this? I'm running VS2008 Express Edition.
View 6 Replies
Oct 22, 2010
In one of my applications, I decided to make a separate project for a few general classes. However, it started to give me tons of errors that I am having a difficult time figuring out.
View 7 Replies
Mar 10, 2011
I have a project that as a standalone runs perfectly. There are a number of routines, forms etc. that I want to incorporate into another solution that I have created. Each time I try, it will load in the new project, but if I try to access anything by clicking on it, one of two things happens, either VS crashes and then restarts OR I get 100+ designer errors thrown.
View 8 Replies
Jan 27, 2011
After upgrading to .net 4, my project is throwing errors everywhere I try and change the Foreground Color in code. It works fine in .net 2, 3 and 3.5
View 18 Replies
Jun 17, 2012
I have attached my project. I have made a web browser I don't get any errors but it doesn't run/debug.I don't know why but i checked everything. If somebody could tell me what's wrong with my project it would be awesomeBill Wiz, on 17 June 2012 - 12:30 PM, said:I have made a web browser I don't get any errors but it doesn't run/debug.[url]...
View 3 Replies
Jul 4, 2009
I have been trying to build the "Testing a class lesson, but the Set as StartUp Project line in the Project menu does not exist! I have redone the entire project 7 times, always the same response! # different computers, all with registered versions of VB. Why does this problem persist?
View 8 Replies
Apr 14, 2009
I am using Visual studio 2008. I didn't see a place to post questions about this . I am creating a mobile application, at run time the executable itself is not updating to show the changes from source code i have written. I feel there must be a setting or something in visual studio .
View 3 Replies
Apr 7, 2011
VB.Net 2k5 Web Application The base application has a web.config file with an httpModules section:The sub-project compiles to the same bin folder as the base application, but I get this message:
Parser Error Message: Could not load file or assembly 'Castle.MonoRail.Framework' or one of its dependencies. The system cannot find the file specified. (c:inetpubwwwrootweb.config line 132)
Source Error:
Line 131: [<]httpModules[>]
Line 132: [<]add name="monorail"
type="Castle.MonoRail.Framework.EngineContextModule,
Castle.MonoRail.Framework"/[>] --- Error here
[code].....
View 3 Replies
Jul 8, 2010
I developed a project is vb.net express 2008. Published it and the whole clickonce didn't work. Now I have Visual Studio 2008. I opened my project and have been working on it for weeks now. when I build it today it said biuld successful but the new .exe file etc have not been written to my Release folder.
View 20 Replies
May 28, 2009
I am having trouble with this code. Can someone tell me why the "Project Processing' section doesn't run at all? The 'Client Processing' section runs and executes find but it seems the 'Project Processing' section does not.
Code:
Public Sub btnExecute_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExecute.Click Dim mBaseFolder As String Dim mProjectFolder As String Dim mClientName As String Dim sClientFolder As String Dim sProjectFolder As String
[CODE]...
View 3 Replies
Sep 23, 2011
I have a .net application that uses customerrors web.config module to display meaningful messages for errors. It works without any issues for 500 errors/exceptions caused by non-ajax and ajax components (updatepanel). However, in a scenario where updatepanel's asynchronous request times out, there is no error raised at all. I was able to see the timeout in firebug and come up with a solution that would at least display the error message as an alert and then redirect the user to the 500 error page using javascript but it's not quite doing what the rest of the application does in case of an unhandled errors like these. I basically just want everything to go through "LogEvent" mechanism so based on the severity of the error, it does the necessary work.This 500 error page doesn't have anything in the Server.GetLastError() for these timeout scenarios. Is this an expected behaviour? Can it be changed so I do have access to these timeouts in Server.GetLastError() OR maybe just run this error through "LogEvent" mechanism? Is there a better/more graceful way to handle this issue?
Below is my code to give you an idea, not exactly what I have in my application but pretty close.
Web.Config
<customErrors mode="On" defaultRedirect="~/Errors/ErrorUnknown.aspx" redirectMode="ResponseRewrite">
<error statusCode="500" redirect="~/Errors/Error500.aspx" />
</customErrors>
[code]....
View 1 Replies
May 28, 2010
I have just received an interesting feedback from a VB.NET customer using our product - for some reason intellisense hidden a certain enumeration value.After a small testing I have found that this is likely a bug in IntelliSense: [URL]..To be honest, I did not expect this problem with such a basic stuff like this. Have you seen this in the past? For me, it doesn't work in all VS versions...
Anyway, feel free to track this issue if you are coding in VB.NET.
View 1 Replies
Feb 17, 2011
It is saved on my desktop for easy access.I can close the program. I can click the solution to open it right back up, no problems.I then zip my file (also to the desktop)
My problem: I moved the original file (Project A) to another folder and extracted the unzipped Project A onto the desktop. When I open the new Project A's solution file, nothing happens besides VB starting up. It doesn't show me anything.
View 6 Replies
Mar 15, 2012
In my application, i have put a question on form closing if the user wants to save the changes?. But right now, i have just put it in default whether they make changes or not.I thought of prompting it on text change.. but the text automatically changes on load as it retrieves data from sql server.
View 15 Replies
Mar 25, 2012
What is the code that I can use to describe what happens when there is not just one exception in a'Try...Catch..Finally...End Try' statement? For example: 'Catch' is used to describe what happens when a certain exception occurs, but what can I use to describe what happens when a certain exception does NOT occur?
View 11 Replies
Nov 27, 2010
Is there some interface I can implement to allow basic comparisons and math to happen as it would an integer?
For example, let's say I have the following class:
Public Class Something
Public SomeBigNumber as UInt64
End Class
I would like to do something like this:
Dim SomethingA, SomethingB, SomethingC as New Something
....
If (SomethingA-SomethingB) > SomethingC Then
'Do stuff
End If
I was hoping to be able to implement some interface (if that is even the right term for it) that would return the UInt64 contained in the class for comparison and math, if possible.
View 1 Replies
Oct 22, 2009
me and a partner need to play sounds when certain events occur, however, every method we try..
My.Computer.Audo.Play("file.wav")
or?
Sound.PlayWaveFile("file.wav") from this class: http:[url]....etc they all don't work
They do NOT throw any exceptions, they just dont play the music, the test demo of the Sound Class works like a charm, its just not working in our project..same with My.Computer. Audio. Play.what could we have done to make it so that we can't play sounds from our application?
PS: this problem occurs on all of the computers we test it on, yet the normal sound-playing methods seem to work on all of those computers when they are implemented in other projects.. its just not working in these instances
View 5 Replies
Dec 11, 2009
Private Sub done_Click(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles done.Click
Dim s As Integer = ComboBox1.SelectedIndex
Dim t As Integer = ComboBox2.SelectedIndex
Dim x As Integer
[code].....
When i go for r <> 0 then it occur twice.
View 16 Replies