Xml Parsing - Closing Tag Is Not Triggering XmlNodeType.EndElement
Feb 2, 2009self closing tag is not triggering XmlNodeType.EndElement case how to check for these
[Code]...
self closing tag is not triggering XmlNodeType.EndElement case how to check for these
[Code]...
i have been visual basic 2008 to create a program which contains a lot of images nearly 1000 my computer is running vista with a 2GB RAM and over 5GB of space free..i keep getting a message about ~"Token Endelement would result in an invalid XML file"~ it then offers me to "save as" it then becomes very slow and will take a while to allow me to get another "token endelement message".i also get one about "exception of type 'system. outofmemory exception' was thrown" the last message, after getting several of the above is "cannot be completed"..i will put a link of my program files (not the images) and would ask for any help as soon as possible as this would save me quite a bit of data i can't remember when i last saved it!
View 1 RepliesI have a program that analyzes and processes a complex xml data source (without a schema).The initial part of the program reads the xml line by line and captures the data value, table name and field name for further processing. The data (xml file) is created using InfoPath. This worked fine until we started using InfoPath 2010, which uses the "empty tag" (<tag />) for empty values instead of the traditional tags with no value (<tag></tag>). Of course my program does not know what to do with the empty tags and just ignores them - no exception, and no error.My question is: Does anyone know how to identify the empty tag using the XmlNodeType object attributes (in blue)?
Private Sub Process_ReportData(ByVal vFilePath As String, ByVal vFileName As String)
' Create an instance of XmlTextReader and call Read method to read the(file)
Dim RecordsTableAdapter As New RecordsTableAdapter
[code].....
I would like to be able to parse vb.net code files, so I can examine the collection of Subs, Functions (and their contents, including comments), private variables, etc. I can be open the actual source code files. So for example, if I have:
[Code]....
I'm creating a vb.net winforms application that will take in user given strings, parse them, and print out labels with variable information. The given string will be used in all the labels, but the variable part of the string will change with each label.
My question is: is it better to parse the strings one time, then store those values in arrays, or to parse the string each time a label is printed? Which will perform better? Which is better practice? What is the proper way to test something like this?
Form1 is a mdi container. It has a bunch of forms that can load inside of it as mdi children. If I close each open form inside the form1, and then click the red X at the top right, application exits fine.If I click the red X without closing the forms inside I get: An unhandled exception of type 'System.CannotUnloadAppDomainException' occurred in mscorlib.dll
Additional information: Error while unloading appdomain. (Exception from HRESULT: 0x80131015) However I can break from it. How do I get the application to not show that error? What must I do to fix those inside forms or close when the red x is clicked?
Dim frm As Form
For Each frm In Forms
Set frm = Nothing
Next frm
The above code is what I used in VB6 to close all forms associated with my programs before my program closed. I have been searching for information on how to make sure all forms are closed when closing a VB2008 program.
I have seen info on using the Project Property Shutdown mode When startup form closes and I currently have this set.
Is this all that is really necessary? Will the garbage disposal close everything else to free up RAM?
Also, if I have several forms open and want to close all from the main form without closing each one individually, what is the best approach? Is there a collection like in VB6, go through the collection, compare it to the name of the main form and close it if it is not the main form?
I have the following code to close a form which is a child. The problem is that when it closes, it closes the MDI parent too.
Private Sub frmTransaction_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
If ListView1.Items.Count >= 1 Then
[Code]....
I have a form that is bound to a table of data. I have a typical binding navigator. When I go to a different record such as next, previous, first or last I need a subroutine named "LayoutAdjust()" to execute "after" the new next record data is loaded on form. I tried calling the subroutine in the "BindingNavigatorMoveNextItem_Click" action but it executed the procedure before the next record data was loaded
View 1 RepliesI currently creating a form to read .csv from floppy and show the data into textbox. But my problem is after i ran the application my pc not stop triggering the floppy drive. The indicator always light up even after i close the application. there any additional code i need to add to my existing code.Im using VB Express 2005 and This is all the code i use.
Dim oXLApp As Microsoft.Office.Interop.Excel.Application
Dim oXLbook As Microsoft.Office.Interop.Excel.Workbook
Dim oXLSheet As Microsoft.Office.Interop.Excel.Worksheet
[code].....
I am using a Combo box control to select from a list of Databases, and when one entry is selected I display a listbox of certain objects in the database.Other controls are then used to filter the list based on either name or content.Now, I want to know how to Re-load the original list based on the current combo box selection by using a 'Reload' button.In the button code I am setting focus back to the combo box, but whatever I try I cannot make the list refresh again. I've tried Select, SelectedItem, Text and Find methods but nothing works.How do I reload the listbox without having to manually use the drop-down and select the same item again?
View 7 RepliesI have two richtextboxes, richtextbox1 and richtextbox2 on top of richtextbox1 with richtextbox2.visible = false on form load. Whatever is input in richtextbox1 is placed in an array when rictextbox1 loses focus. Now I have a checkbox that when enabled, hides richtextbox1 and shows richtextbox2. On the first time richtextbox2 is shown, i want it to display the contents of richtextbox1. This is achieved by setting a boolean flag (firsttime=true) on form load, then in the checkbox code if firsttime = true, it displays content of richtextbox1 and sets firsttime to false.
[Code]...
I have a checkbox X1 that if checked it will check a column of checkboxes.What i'm trying to do is if the user unchecks at least one checkbox from the column it will uncheck checkbox X1. But I don't want it to run the event from checkbox X1 again because that will cause the whole column of checkboxes to be unchecked.
View 2 RepliesI want to make something like an alarm clock. So, I want my programe to trigger a certain event at lets say, 8:00 AM and 16:00 PM.
I was thinking something with timers ticking every second and checking if the time I want is equal to the system time. But....I didn't manage to make it work. So, how do I make this work ?
with vb.net exp08 + access03
i want to check if the user not triggering any events in the application for => 30 min then i want the application to log off
how to do it ?
i am using two timers for the purpose to elapse the time but it is hard to call the function for every control + event
hence i am looking for a universal code which detects any kind of event and activate / deavtivate my timers
Have created a few stand alone projects but nothing major... Using a trial of VB Studio 2010 (.net 4)
a) I have two networked pc's ("PC1" and "PC2") with a solution on each which has a "textbox" and a "send" button. Just want to type "hello" in textbox on PC1 then hit send and it appears in PC2 textbox so that I can base if statements etc. on it.
something like:
//PC2.App2.textbox2.text = textbox1.text
on a button would be perfect but i'm guessing that's far too simple.
b) Video Triggering over network - pretty well sames as above, just want to hit button1 on PC1 and it plays "1.wmv" in "axwindowsmediaplayer1" on "PC2".
c) How can I play a .mov/vob/avi/mpg/flv in an "axwindowmediaplayer1" ? if not possible how do I go about playing videos of all types in my programs?
I have a TreeView object on my form, with check boxes. By the way, I'm working with vb.NET. I want it to perform a few different things with the aftercheck event:
If you check a node, check all its children
If you uncheck a node, uncheck the parent node
If you uncheck a node, uncheck all its children
The problem is when you uncheck a node, it unchecks its parent node, which triggers the event again and unchecks all its children.
Would there be a way to prevent the event from triggering a second time? Or will I have to give up on one of those two points?
Here's the code, if it helps any:
If e.Node.Level > 0 Then
If e.Node.Checked = False Then
If e.Node.Parent.Checked = True Then
[code]....
While I'm at it, is there a way to check if a folder is accessible? I've toyed with FileAttributes, but can't seem to find out how to make it work...
I need to trigger a submit when saving my image file in SQL 2005 database. A user will upload their image file.My application will then check to see if the image file size is within specific requirements.If so, then save the image into a table where the field is image data type. (if size does not meet requirements, display error message and exit sub). The issue is if I save the image file to the database, the value is saved correctly (however, I have not checked the image size).
If I check the image file size first, THEN save it, the value saved is corrupted (incorrect). Is there a way that I can check the file size, then save the file while doing a submit in code-behind?
My code is below:
Dim iRequiredImageHeight As Integer = 80
Dim iRequiredImageWidth As Integer = 280
Dim imgBytes(FileUpload1.PostedFile.InputStream.Length) As Byte
[code]....
I need a simple system that allows one process to check if another process is running (I think I can do that fine using Process.getProcessByName or similar) and then trigger an event in that process assuming it is.When I say trigger an event I do not mean that literally. I simply need to trigger a sub in the first process from the second.I know that IPC like this would normally be done with pipes or remoting or something like that but I have no experience with these and am looking for a quick solution, so unless these can be used relatively easily to solve this I am looking for an alternative.
View 2 RepliesI have a number of textboxes on a form, and I want them all to accept the ENTER key. When the ENTER key is pressed, I want it to trigger the validating event. I know it will look something like this:
Private Sub Textbox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Textbox1.KeyPress, Textbox2.Keypress
[Code].....
What code can I use to cause the validating event to fire? I'd prefer the focus to stay in the textbox.
I've got a piece of code that inserts a row into a table - the kind of thing I've done in dozens of other apps - but the end result is nothing happens on the database end, and no errors are generated.
Here's my code:
Partial Class MyDatabaseDataContext
Public Sub CreateEnrollee(subId, depId)
dim newEnrollee = New enrolee With {.subId = subId, .depId = depId}
[Code]....
After SubmitChanges is called, no new row is created, and "test" is zero. No errors are generated. I have no idea why it's not trying to insert the row.
[URL]
I'm using FileSystemWatcher to monitor a file on a windows server which links into a news ticker on our desktops. The ticker watches the file and updates accordingly. I've successfully got the ticker to watch for a creation and deletion which is great but the changed function doesn't seem to trigger. Out of interest, I tried this function on the network drive AND a local disk with the same results.
I've upped the buffer but I can't see what else I can do to change it! In the short term, we can probably live with just deleting and recreating the file with any changes that are required, but it would be nice if the ticker would just watch for file changes.
I am still in the conceptual(planning) stage so I do not have a code to show as an example.[code]...
Example: A user visits the form, the cursor by default(Tab Order) is in the first TextBox. If the user tries to leave the box without
entering any information an error is displayed. The user cannot leave the TextBox(MaskTextBox) unless they enter valid data.
If the user enters valid data the error message goes off and the user is able to leave to the next TextBox.
I also have a bunch of RadioButtons, CheckBoxes and NUD that I would like the user to play with without trigger the error messages on the TexBoxes. If the user click a check box or radio button, I need the error message to stay off, the error message should only trigger if a user click in a text box and a: Decides to leave without entering data or b: enters a wrong data.
I know other ways to do this, example using a submit button to do this. However is my idea possible? Can you have a field(controls) the validate on leave and click other fields(controls) without triggering it?[code]...
I have only started using VB yesterday and have managed to make some very basic programs run. What I am trying to do now is design a program that will play 4 different sound files depending on the position of a joystick. I am not looking for any kind of gradient to be involved. Any kind of forward position should play the file associated with "forward". Any kind of left position should play the file associated with "left". And the same for "back" and "right".
View 2 RepliesI have inherited a control and added the Validating and Validated events to it, the validation works when the I set focus on another control but somehow it is not being triggered when a StatusStrip button is clicked hence I need to be able to trigger the validation.
[Code]...
Let's say I have items in my WinForms application which have an expiration date. I have more different conditions than this one but let's do it simple. I'd like to trigger an event when an item comes to expiration. What is the ideal way to do so? Checking every X minutes?
View 3 RepliesI'm converting an old VB form to .NET, and there a few Buttons which each have a corresponding ComboBox hiding behind them. The previous behavior was that you'd click the Button, and that would trigger the ComboBox behind it, which would then drop down a selection list. I believe the idea was to have a static color and text label (which cannot be a selectable option in the drop-down list), with the functionality of a ComboBox.
Now, in VB.NET, clicking on the Button (which is directly over the ComboBox in the form) won't trigger the ComboBox dropdown anymore. However, if I make the ComboBox visible enough to click on, it will trigger the ComboBox.TextChanged event, and show the drop-down (they're set to the DropDownList style). I've set the event handler to handle both that event and the Button event. I've tried Button.MouseDown, Button.MouseClick, and Button.Click -- none of which have worked.
I did find the SplitButton control option suggested here, which would probably do the job, but I don't want to have to integrate a non-native control for just 3 buttons. I don't really want to mess with the control template, either
Using VB 2008 Express I have a form in which a number of controls which have event handlers to monitor choices the user is making. The event handlers do work as expected, but the problem I'm having shows up when I load the form.For example, I have:
Code:
Private Sub RadioButton6_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton6.CheckedChanged
MsgBox("I got checked!", MsgBoxStyle.Critical)
End Sub
When I load the form in question from the main form of the program, I get the message box, even though the user hasn't actually clicked the radio box. The problem arises when I try to use a call to a function that works fine, as long as the entire form has loaded. Called prematurely, the function fails.How do I solve this so these event handlers don't trigger when the form is being loaded?
I'm trying to reset a form after a game has been played. I used checkboxes to indicate when the user picked a particular line item to update and then flagged the checkbox as checked and disabled.Once all the checkboxes have been checked, the game is over and I want to show a dialog (msgbox) that will allow the user to start a new game or exit the app. To reset the form, I was changing all the checkstates back to unchecked (along with resetting other variables), but the checkchanged events are being triggered and I end up in a loop.Is there a way to change the checkstate without triggering the event?[code]....
View 2 Replies