I have written an MDI text Editor and I have written a "save" sub routine, please see below
'This sub routine updates the current document or calls the save as routine
Private Sub SaveToolStripButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveToolStripButton.Click, SaveToolStripMenuItem.Click
[code]....
I am testing this sub routine today and it throws up an error during runtime when a new document is created and the user (me in this case) writes a few lines of text, I click the save toolstrip button and because its a new document, the save as sub routine is supposed to be be invoked, however the application stops running and I get this error message "ArgumentNullException was Unhandled" from Visual Basic.
[code] I'm basically trying to see if a record already exists. My problem is when I run this I get a "ArgumentNullException was unhandled" error It occurs on the line "dbAdapter.Fill(output)" in the sub.
I'm getting the following exception when I try to run up my Winforms app and haven't been able to find a solution to it:
System.ArgumentNullException was unhandled Message=Value cannot be null. Parameter name: activationContext
[code]....
I've added a handler for the "unhandled error" event in the applicationevents class but it never reaches that stage and there is no source code running that I can break into and diagnose.
The application was fine until I added a user control (nothing fancy, just a standard windows user control) and then dragged it onto a form in the app (user control and form were in the same application). The application builds and compiles without any errors or warnings but when I attempt to run it up I get the above error straight away.
Does anyone have any idea what it could be or even how I can go about investigating it? I'm a bit stumped on this one as I'm not sure how to investigate it. I removed the user control from the form and then I removed the user control from the application entirely but the error hasn't gone away. In all honesty the addition of the user control might be a red herring but the problem manifested straight after adding it.
I am using 2005 and I am getting a ArgumentNullException when I try and debug my program. I have included the error and a piece of the code. I am not sure how to fix this error at all. If more of the code is needed I can post it.
Public Class MainForm Dim sPIServer As String 'PI Server Connection Storage Variable Dim myServer As PISDK.Server 'Variable to hold the server to work on[code].....
Dim mightBeNothing As List(Of String) = Nothing Dim a As List(Of String) = IIf(mightBeNothing Is Nothing, New List(Of String)(), New List(Of String)(mightBeNothing))
I am getting ArgumentNullException on the second line. If I replace the last part with:
Dim a As List(Of String) = IIf(mightBeNothing Is Nothing, New List(Of String)(), New List(Of String)())
It works - but the constructor New List(Of String)(mightBeNothing) will never be called if mightBeNothing is nothing, so what is the issue?
i have an ASP.NET page which has a numebr of user controls within it. There are 2 user controls which are of interest. I need to display either one of them or neither of them, depending on the record selected previously.
In the user controls I need to set properties of some controls which are in a FormView. So in my user control code-behind I have a number of properties which look something like this:
I've been having problems with following code on some computers, while it's worked super on others (most):
Dim xmlSer As New System.Xml.Serialization.XmlSerializer(GetType(XMLContext)) which produces the stacktrace: System.ArgumentNullException: Value cannot be null. Parameter name: type at System.Xml.Serialization.XmlSerializer..ctor(Type type, String defaultNamespace)
How can that code throw that exception, when the argument is drawn from a gettype call, and note that it doesn't happen when debugging on my own PC, only when it's installed on some of the client PC's???
Dim CustID As String = txtSrchCustID.Text Dim FirstName As String = txtNewCustFName.Text Dim SecondName As String = txtNewCustSName.Text If CustID And FirstName And SecondName = "" Then MsgBox("Please enter a term to search by") EndIf
This returns "Conversion from string "" to type 'Long' is not valid." I was wondering what the error is and how it's possible to fix it? The other questions that I've looked at were mostly to do with variables assigned incorrect types, but I think that isn't the issue. It occurs when all of the variables are empty.
This never happened to me, and the less data one has (usually) the less you can say what happened.I am trying to write a simple query analyser. I randomly receive these kind of crashes:
[Code]...
The file specified above does not exist. The place where it crashes is wrapped with Try-End Try. Moreover, yes, I have the painting event set up but it should not concern it (or maybe it does?). I have to add that I use visual basic express edition. The error occurs ocasionally - sometimes when I'm lucky nothing happens, and when I'm not then I get this crash.
I am trying to debug my program and I am getting an OleDBException Was Unhandled. It then goes to the path where the error is located. The executable is listed in the bin file and I have re-built and built the application several times. The application is supposed to extract data from an external MS Access database. Note my code:
Public Class frmSpanishFoodStoreInventory
Private Sub StoreInventoryBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles StoreInventoryBindingNavigatorSaveItem.Click
Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress If e.KeyChar = Chr(13) Then
i keep having this error. ERROR: FileNotFoundException was unhandled I want it to display the picture i get it from the database which is the strPic. But i don't know how. And when it run i look at the highlighted error, it link to bindebug ame but my picture is already in there. how can i link the path to the folder i created to put the picture?
OK, this is going better, now im stuck in the mud again, i am trying to get a form to print,this works now, however i would like to enable a few frames with text boxes for a few seconds to allow the printer to print the text in black instead of gray. he error i am getting is this, as the timer disables:" Unable to cast object of type System.Windows.Forms.Timer' to type 'System.Windows.Forms.ToolStripMenuItem'. "
I have a program that can save user's input into a text file and load it back, but whenever I try to open a text file and exit without selecting the file I get an error.(if i select the file and open it i don't get any errors).
Private Sub gvDesignGVnote_CellClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles gvDesignGVnote.CellClick If e.RowIndex < 0 Then[code]......
All of a sudden, when I built my project, it wouldn't read any changes, then all of a sudden, this error started popping up!The description of the error is:An error occurred creating the form. See Exception.InnerException for details. The error is: Object reference not set to an instance of an object.and it pops up when the following code is executed:
frmMain.Show()
on the line prior to it I have the code
frmStats.Show()
and that pops up no problem.These errors happened suddenly, and all I was changing in the code (which was in frmMain) were just a few changes to labels (activated by an event).
I get the following expeption when trying to switch from one form to another (click event):
InvalidOperationException was unhandled
An error occurred creating the form. See Exception.InnerException for details. The error is: Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "WindowsApplication1.CarDimensions.resources" was correctly embedded or linked into assembly "Driver Seat Configuration" at compile time, or that all the satellite assemblies required are loadable and fully signed.
How can i embed one form correctly into the another?
I have a RDCL Report called Report1.RDCL.In this report I put an image box named logo the select image Source is set to EXTERNAL and in the use this image I have=Parameters!LogoPath.Value.I would like the users to be able to pick their own logo.How can I pass the file path to the paremeter. In the following code I get the 'localProcessingExeption was unhandled' error
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click Me.Services_QryTableAdapter.Fill(Me.DataSet1.Services_Qry, Me.TextBox1.Text)
This is driving me slighty madder than i usually am. The thing thats bugging me is the EXACT same code works in a test project i did with an sdf database.See my comments in the code
vb Private Sub tbScan_KeyUp(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles tbScan.KeyUp
I have run my program a thousand times throughout its creation and have never had a problem. I entered some code for a NumericUpDown control, and now I get this error whenever a variable is assigned a value. The code for the NumericUpDown control doesn't contain anything, really. No new variables, nothing. If I take the code out, the program works just like it did a thousand times before. What gives?
i tried to figure it out few hours but i getting no way to solve it. I think i have sucessfully bind the datatable from the datagridview but just couldn't get it to update to access mdb table. It showed "Syntax error in Update statement" whenever i press the Button1.
i am in project of medical billing.i am on LogIn form in vb.but i have Erro - "InvalidOperationException was unhandle " and while i was run program it didn't say which line i had error.
here is my code.
Imports System.Data.OleDb Public Class login Inherits System.Windows.Forms.Form
I have made a tic tac toe board and when i go to debug the application i get a "NullReferenceException was unhandled". this happens diring this part of the code: