Dim xpDoc As New XPathDocument(strXmlUrl & strXmlInfo(0) & "?xml=1")
Dim xpNav As XPathNavigator = xpDoc.CreateNavigator()
Dim xpExpression(9) As XPathExpression
I have an small physics toy application I am developing. It works fine except the particles will not push each other away, only pull towards, I debugged that sub going through it command by command and realised the value 'H' would not change, what ever it was set to during the first pass through the sub is what it kept, the only way to change this value is to manually set it i.e 'h = 1'. Once the calculation is redone on the 'H' value it resets to what it was previously, even though the x1,y1,x2,y2 are all different, thus meaning H should be different.
I think it is me that has made a mathematical mistake somewhere, but I cannot see where it is. I need a fresh pair of eyes to look over my work. Please let me know if you find anything.
I have been developing an antivirus using vb.net. The virus scanner works fine but I was thinking of ways to optimize the scanning speed (because large files take forever)
Ok, the error I'm getting is "Load Report Failed" and it happens when I need to load a large number of crystal ReportDocument objects. I've searched on this, and there is a property in the registry that you can change to -1 and it allows to load more, however I'm still getting the error, just after I get about twice as many documents loaded.
The report is basically a one page document (for each client in the database with an interest charge). It displays the amount of interest charged, and other information pertaining to the charge. These documents are basically printed out and mailed to the client.
I created a "Print Preview" screen which has a CrystalReportViewer object, and an ArrayList property. The ArrayList property has an array of all reports, and there are next and back buttons to browse through each report. Once they are satisfied, they will print them all out, and I can dispose of the objects.
The solution for this, from everywhere I've seen, is to "Dispose the object after you are done with it". My problem is that I can't dispose it until they are finished with the print preview screen.
Is there a better way to go about this that won't require too much time to code (we are already over the deadline on this project) or a simple solution to get past the ReportDocument limit? Right now it is erroring on report 150., There are 180 records (as of today) that need to be loaded.
all classes inherit docMain and addTemplateToList( X ) adds x to a List(Of docMain). Now my question is: Is there a better way to do what's done in the code sample? I thought of something like:
How can I Optimize my own code written by VB.net? Is there any tools for it? Does Visual Studio have any one? What's your suggestion? I use VS2008 as my editor.
I have a DataGridView where I bind a datasource (sql query) to it. The row count is high with many columns. Trying to scroll through this DGV is painfully slow.
Does anyone know of any kinds of optimization I can do so that I can scroll faster? Like what is the DataGrid doing when you scroll? Does it repaint every screenful? Does it validate every row? It seems like it is doing something unneeded when a user scrolls.
The following code takes a timeframe in minutes since midnight and creates an array with minutes pr hour. But, it's slow. Any better suggestions out there? (no, changing language is not an option :-) )
Const clDeparture As Long = 123 Const clArrival As Long = 233 Dim lHour As Long Dim lMinute As Long Dim alHour(25) As Long
I came across the following code recently and would like to optimize it:Public Shared Function ComputeLabel(ByVal Action As Integer, ByVal Flag1 As Boolean, ByVal Flag2 As Boolean) As String
Dim Prefix As String = "" If Flag2 Then Prefix = "Conditional "
I have written a code which does the thing as the title says. The problem is, the whole process took 10 minutes just for 1000 records. Here is the code:(Written in vb.net 3.5 and sql server ce)
MyConnection.Open() Dim count As UInt32 cmnd = New SqlCeCommand(sqlstring, MyConnection)
I'm wondering if you know if there is a better way to write this code in order to speed it up. It has several blocks of if statements filling arrays, like this:
row0: If x < b(1, 1) Then a1(i, j + 1) = 0 If x > b(1, 1) And x < b(1, 2) Then a1(i, j + 1) = 30 If x > b(1, 2) And x < b(1, 3) Then a1(i, j + 1) = 60
i am trying to add a text file in Debug folder. But when i go to project tab to add a new item, there is no option to add a new item? What part of the setting needs to be changed? Using Visual basicExpress 2010.
I am working on a project in VB 2008 and need it to do this:Read first line from text file (using Openfile)Enter line into textbox on formDo some other codeThen Read second linefrom text fileEnter line into same text boxand loop until we have gone through text fileI am not sure how to read line by line from text file then enter it in textbox. I can open the Openfile and get the filename and everything, but I just am not sure how to read from it or enter that line into the textbox.Here is what I have, its not much but its a start:
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Dim FileReader As StreamReader
I have a dictionary object (let's call it _do) I am using to cache some values for use in a multi-threaded program. I have a single controlling parent thread, with a timer function _doTimer() which can kick off child threads with a new instance of class MyThreadObject in each. My parent thread has _do as a property and with each time _doTimer() gets called, it may or may not repopulate _do depending on cacheflag settings. I pass a reference to _do to each instance of MyThreadObject and those threads at some point read the values of _do but DO NOT write to it.
What I want is to ensure that the child threads do not try and read _do whilst the parent thread is writing to it. Same thing but very slightly different -> I also don't want the parent thread to write to _do whilst the child threads are reading from it. However there is no problem with 1 child thread reading the values of _do at the same time as another child thread is reading the values - so ideally I do not want each child thread to completely lock out read access, only locking out Write access.. The code is roughly like this:
I am trying to develop a tool for use with an online game which has XML files available online (not downloads, automatically updated XML website things). Sorry if I'm not too clear as I don't truly understand how they work or anything!Anyway, I am trying to make a vb.net program access the information stored in these online XML pages but am having some difficulty. For a start, I tried the vb.net's help files which didn't help a great deal (well done Microsoft) because of the lack of informative comments on each code sample. It merely said that the output would be this (didn't even say where this output would be.
Next I tried searching the web but although I found a few things, some on this site, most of them were questions where the person already had a good knowledge of XML usage so they didn't put many comments on their code.
I am using following code to read text from a .txt file. But I don't know how to perform search within file and how to read a specific line in the text file, based on search.
Dim vrDisplay = My.Computer.FileSystem.ReadAllText(CurDir() & "keys.txt") MsgBox(vrDisplay)
For an example, if I want to read the line that contains the word "Start", how to do that?
I have this code and I have no idea why it's not working.
Using parser As New Microsoft.VisualBasic.FileIO.TextFieldParser("\server etlogoncsvsstafflookup.csv") parser.SetDelimiters(",")
[Code]....
I want it to read the left value in a csv, if it matches the username then the ADGroup sets to the right column (so we have staff name and then year group)
This code seems to be skipping lines though and not going through each one but I don't know why.
I have a vb.net POS application which creates a CSV file (three actually) to store data for later import into a database. All is working well with that part. Details and what I would like to do now follows: A single row of data in one of these files looks like this:
There are 11, I will call them columns, in each row, with varying number of rows each day. I need to extract only the information in column 10 from each row and total these numbers. I could do this with a FileOpen(1, <fullpathtofilename>, OpenMode.Input) and an input(1,<variablename>(i)) for each row in a FOR loop. This seems to be cumbersome and a waste of resources especially when the file is very large. Is there a easier, shorter, better, faster (use your own expeditious adjective here) way of doing this? Is there a way to read only the 10th item in each row and for how ever many rows there are? Something like this maybe:
I am making a browser in vb which can import IE favourites. Here is my code so far:
Dim favespath As String = Environment.GetFolderPath(Environment.SpecialFolder.Favorites) Dim info As New IO.DirectoryInfo(favespath) For Each fi In info.GetFiles
[code]....
But my code returns a load of HTML instead of the target of the .url file.
I am looking to right a vb application that will read a cr2 file (cr2 is a images raw file) I want to be able to read the file resize it, save as a jpg, and auto post to my facebook albums (I have the facebook part done)
The way this file works is there is a null buffer, then a user check sum then a byte that gives you the user name letter count, then a byte for how many bytes to skip to the next user and a byte for which user file the user keeps their settings in.
the loop with the usersm variable in the IF statement sets up the whole file stream for extraction. However with almost the exact same code the else clause specifically the str.Read(xnl, 0, usn - 1) in the else code appears to be reading the very beginning of the file despite the position of the filestream being set earlier?
this is in vb2005
Private Sub readusersdata(ByVal userdatafile As String) ListView1.BeginUpdate() ListView1.Items.Clear() Using snxl As IO.Stream = IO.File.Open(userdatafile, IO.FileMode.Open)
I'm trying to read a .txt file line by line, but Visual Studio doesn't like what im doing. Here's my code so far:
Private Sub LoadGenre() Dim StrApplicationPath As String = Directory.GetCurrentDirectory() & "" Dim inputStream As StreamReader = File.OpenText(StrApplicationPath & "myfile.txt")
I'm trying to read a XML file, but only certain values.So my XML file is built from the result of a SQL query.[code]The probelm is the loop starts with line 1, good start.But then it will go to line one again, then line 2, line 2 again and so on.When it hits line 5, the first value I need to pull, it then stops.And thats how it is written, so that makes sence.I need to loop through this document, grab the certain values I need, and move on.