Forms :: Exception While Updating The Array?
Nov 14, 2009
I am getting Error while updating the sting array Settings() which is Declared as Global. I am getting Array IndexOutofBound exception in runtime, what is the error in the code?
[Code]...
View 1 Replies
ADVERTISEMENT
Sep 21, 2010
I'm working on a website where we'll be getting a lot of videos to be uploaded. To keep things simple and secure, I'm just writing VB.net windows app to suck all the files in a directory in, allow you to set some options, and start the encode by spawning a new FFMpeg process.
[Code]...
View 5 Replies
Jun 23, 2011
n my project i am to enter a name and a test mark into two separate text boxes and then select the button to store the information into the arrays, one array for names and another for marks, but when it is reset using the Erase <Array> fuction andi try to re enter information, no matter what information is entered i get a "Null Reference Exception Unhandled" Error.I am using Visual Basic 2008.My code is as it says from now:
Public Class frmAdverageTestMarkCalculator
Dim ClosingMsg As String
Dim Closingtitle As String
[code].....
View 7 Replies
Oct 9, 2009
I am working on a code that should capture the color of a pixel in a bitmap and then check if the 8 surrounding pixels have the same color. If the checked surrounding pixel HAS NOT the same color it will be ignored, otherwise if it HAS the same color, it should check for its own 8 surrounding pixels and so on.
To do that, I have created an array that starts with a single entry (the x,y coordinates of the initial pixel). So, when a pixel with the same color is found it is pushed to the end of the array. I used a for each loop supposing that VB would keep looping until the end of my array - and since it is growing, the last position of the array would be always pushed until I have not more pixels to be checked.
The problem is that VB is not respecting it, and is considering my array as if it had just 1 entry. Seems that it catch the size of the array when it enters the loop, and regardless the fact I have pushed new items to the array it doesnt keep looping it.
How can I force VB to update the end of array position while looping it? Although I think it wouldnt be necessary, here it goes the code I have so far...
Code:
View 3 Replies
Apr 14, 2011
An unhandled exception of type 'System.StackOverflowException' occurred in System.Windows.Forms.dll it also says make sure you do not have infinate loop or infinate recursion il give all code in order that they are executed in Check the chechbox and it disables all irelevent stuff and populates the combobox
Private Sub CheckBox_Spray_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox_Spray.CheckedChanged
If Me.CheckBox_Spray.Checked = True Then
[code]....
View 4 Replies
Aug 26, 2011
I would like to update string arrays in batchlets say I have 3 string arraysI want to for example redim them and then up load them with data.I have tried for each on array of arrayI have tried list.at the end none of them are updated.
Dim Str1(10) As String
Dim Str2(10) As String
Dim Str3(10) As String
[code].....
View 3 Replies
Apr 18, 2011
I am creating a form in VB to enter customer sales invoices and need to update two tables i.e. InvoiceHeader and InoviceDetails. The Invoice details can have more than one line for one Invoice header. I was wondering if there is any thing like Access subforms or how can I update both tables through an SQL statement.
View 1 Replies
Sep 15, 2010
I have controls on a form, bound to an SQL data source. The information populates the control well. When I change the text in a bound textbox, I want it to be reflected in the SQL database. When I change the text in the control, the DataSet is updated. Now I need to make the DataSet update the SQL table.
[Code]...
View 1 Replies
Apr 11, 2011
I have added a SQL Server datasource through the wizard. I created my forms which were bound to the dataset. Is it possible to change the datasource and dataset names while updating the dataset the binding controls of the form?
For instance, Server 1 has DB1 and Server 2 has DB2 (DB1 & DB2 store the same information/tables). Is it possible to keep the forms and only update the binding information if I want the forms to use DB2?
View 3 Replies
Jun 19, 2012
I'm having some issues and it's all explained in some simplified code I have a structure
Public Structure myStruct
Public Property name As String
Public Property span As Double
Public Property offs As Double
End Structure
Which is instantiated in a Singleton object as follow
Public myValues(10) As myStruct
Then on a form, I'm using the structure as the DataSource for a SourceBinder and the binder as DataSource for a DataGridView.On loading the form, I get all the values into the binder
For i As Integer = 0 To 9
binder.Add(singleton.getRef.myValues(i))
Next i
All the values are shown on the grid.User is supposed to be able to change the values, which should reflect on myValues but no matter, what code I put on CellValueChanged or CurrentChanged. I can't make it reflect the changes. Using breakbpoints on those events, I noticed that grid.row().cell().values and binder.current never changes.I tried also placing a button and directly changing myValues and reseting the binder binder.ResetBindings(False) and nothing happens.As far as I saw all ReadOnly properties are set to false.I've also tried setting VirtualMode to true on the grid and catching CellValuePushed and CellValueNeeded events but those are never called.
View 1 Replies
Aug 24, 2010
i have lurked on these forums before and finally signed up..i have a situation that, after days of searching the web, i have not been able to come up with a solution for.i have to fire off a function that takes a large amount of time (writes to database, creates files, etc etc)this function is a non-shared function of a class. if need be i could make it Shared.[code]the code works great, but what i need to be able to do is update a form with a progress bar as the job is processing.all of the examples i have seen that do this are being called from within a Windows Form and they access the form directly - i cant do that in this case. my form needs to be 1 form for 1 job being executed - can process multiple jobs at one time and thus i need multiple forms.i have tried making the form part of my delegate class but since it runs in the same thread the effect is it "freezes" until the job is complete.i have just started looking into using a background worker but again, all examples i have seen use the component as part of a form - that wont work for me.
View 3 Replies
Nov 2, 2011
I've been programming in vb.NET for a whileAnd to be honest, its turning out to be a real pain.Here is the
Form1.vb: Imports System.Threading
Public Class Form1
Dim trd As Thread[code].....
So, I have a form (form1) with a label on, this label simply reports the status of the thread.The thread begins the Class1.Main() sub, and I have a delegate setup to change the text propoerty of the label.Now,I know the label is created on the UI thread,so I assumed the delegate would work. However,it seems that it updates the .text property, but doesnt redraw the control when .Update() is called .What am I doing wrong?I have found lots of examples of delegates, but all run from within the same class. I want to use threads too, not a backgroundworker! This code is a "simplified" version of a project I am on, which is encountering the same problems
View 17 Replies
Feb 24, 2012
The following sub is throwing a"Object reference not set to an instance of an object."
exception.
For Each element As Song In modFiles.getSongs()
Dim col(2) As String
[code].....
View 2 Replies
Apr 19, 2009
I started programming in VB2008 couple of weeks ago (I'm using the express version) and I'm getting stumped by this ridiculously simple problem. I am trying to retrieve varying parameters from an external application and display their values in real time on a windows form control e.g. a label or text box. I already know what class and methods to reference for that, however I can only display instantaneous values (unless I use a .click event handler, but thats foolish I want them displayed without my intervention) I tried writing a loop in form load event handler but that prevents the form from loading. I also tried a loop in another module but that doesn't work either.
View 2 Replies
May 8, 2009
It is possible to catch an exception and throw a new exception which wraps the first exception as an inner exception: [URL] Also, if I call a function and it throws a certain error, but I catch it, will the calling code's catch handler execute? If so, and it is of a higher exception type, is this not wrapping the exception? eg I can throw exception ex of type IndexOutOfRange, log it but rethrow, catch a higher up exception and do something, or I can throw a new exception and wrap an inner exception like:
View 1 Replies
Jul 28, 2010
(The following code cant work , it just wont update.. my bar default max is 80 and its still shooting over 80, its not dividing)
Sub displayprogress(ByVal amount As Integer, ByVal progress As ProgressBar)
progress.Value = 0
For i As Integer = 1 To amount
[code]....
i did try replace the question with SQLLquestion(0) but the result given was 0 and not the question from database i tried calling function sqlquestion() from one of the form but it just cant work i think tis wrong...
View 7 Replies
Apr 13, 2009
I have to copy a List of Books given below to a Multiline TextBox and then parse the BookName and Version to be stored in a varaiable called _BookName and _Version which i will use to store it in a database later. When a Line is successfully read i want to delete that particular line from the Multiline TextBox but i am getting "Index out of array exception".
BookName: Design Analysis, Version: 18
BookName: Metals and Non Metals, Version: 12
BookName: Surface Diagram, Version: 10
BookName: Elements and Compounds, Version: 10
[code]....
View 1 Replies
Dec 22, 2009
i am creating a login page in VB.NET, where a user enters the email and password and clicks submit, then the user is taken to a secure page. login.aspx is the page.but i am getting this exception
Description:An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.IndexOutOfRangeException: Index was outside the bounds of the array.
Source Error:
Line 10: Using conn As New MySqlConnection(conInfo)
Line 11: Using cmd As New MySqlCommand(query1, conn)
Line 12: cmd.Parameters.AddWithValue("", txtUserName.Text)
[code]....
View 8 Replies
Feb 24, 2012
I am getting an exception when running the following code.
Public Function getSongs() As Song()
' Dim dir As New DirectoryInfo(Application.ExecutablePath)
Dim dir As New DirectoryInfo(directory)
[Code].....
I get an uncaught exception that says:
"Object reference not set to an instance of an object."
The song object has a:
Public Sub new(By Val filename as String)
... sub that sets a variable and retrieves file info (this code works)
View 3 Replies
Nov 1, 2011
What I am trying to do is to instantly apply a filter to a large list of data such that the list is updated almost immediately regardless of the number of items in the list. I have this working using a listview right now but it is far from instant, a list of 5000 items takes over a minute to get through. What I do currently is to maintain a cache of my data that my listview entries are based on. When the user selects a filter I parse this data one item at a time and determine if each item should still be displayed in the listview, if not I remove it. The complexity of determining whether or not a data entry meets the filter requirements is O(1), but just getting through each element in a loop takes significant time, and so does updating the list view graphically at the end of the process.
I have considered using a datagridview instead, using a database connection. I have never done this before and my main question here is whether this would allow me to do what I have described. With the database I could form an SQL query to return only the items that meet the new filter requirements... but would the data in the form update immediately, or would there still be significant delay?
View 3 Replies
Sep 22, 2009
i am using data grid view.if i loaded this data grid view with about 15 and above rows and traverse in data grid view by pressing down arrow key then an unhandeled exception throws.The unhandled exception is as below value of '176' is not valid for 'value' .'value' should be between 'minimum' and 'maximum' parameter name value..
View 2 Replies
Nov 25, 2011
I tried the following : (VB.Net code)
[Code]...
View 1 Replies
Jun 16, 2012
I have designed a form which contains a listview(to see the list records) and textboxes (used for adding or updating).an already save record into table using this
cmd.Connection = con
cmd.CommandText = "INSERT INTO student_info_tbl VALUES('" & txtUserId.Text & "','" & txtFirstName.Text & "','" & txtMiddleName.Text & "','" & txtLastName.Text _
[code].....
View 5 Replies
Feb 17, 2009
Now I need to avoid exception error for when I move, minimize and close any of the other 3 forms for the program I am building. ZOrder?. I was thinking of using an if statement to determine the zorder of each form. I need to know how to implement the if statement.
Option Explicit On
'Route User to the desired page
Public Class Form1
[Code]....
View 1 Replies
Jun 2, 2011
See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box. [Code]. When JIT debugging is enabled, any unhandled exception will be sent to the JIT debugger registered on the computer rather than be handled by this dialog box. What is this Error about, can anyone explain please?
View 4 Replies
Jan 21, 2010
I am using VB 2008 Express Edition.I have an app that has 2 forms (will be adding more). Button click on form1 opens form 2. The first time I run my app everything works fine, but when I click the close 'X' button on form 2 and try opening form 2 again by clicking the button on form 1, VB throws a Object Disposed Exception, Cannot access a disposed object.[code]
View 13 Replies
May 15, 2011
I am getting System.NullReferenceException:Object reference not set to an instance of an objectwhile executing the below code..!!
Dim arr() As Integer
Dim g,j As Integer
g=10
[code]....
View 2 Replies
Aug 20, 2010
I am getting the following Exception when calling MyBase.Dispose ()ObjectDisposedException was unhandled.I tried adding a Try Catch around the call but it doesn't catch the exception.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
[code]....
FYI: The value of disposing is False
View 1 Replies
Apr 7, 2009
I am having and issue with Entity Framework. I have had it working, but have now added several more entities to the model, and now I am getting the above error. For debugging purposes, I have created a test form with a grid control to populate from my Projects entity collection. FYI, I am using GUID's for my primary keys. I only have one bit of code:
Public Class TestForm
Private Sub TestForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
[Code]....
View 2 Replies
Dec 28, 2011
I've converted an application for connecting to a vpn server and starting a remote desktop connection from vb6 to vb.net. But now when I'm trying to run the program I get an ArgumentNullException I've tried searching for a solution but I've been unable to find one. Below is my code:
[Code]...
View 8 Replies