I am using XMLReader to look thru and XML file that I have. While I have been able to play around with it and get it to pull some of the information I want, I am wondering what commands to use to do what I really want.For example, I really just want one line of information in the XML File. it uses tags for the name of a string that follows it, heres an example,Serial Number1234567890...this format is used for other parameters also, but I just need the actual string of serial numbers. Is there a way to tell the reader to search for "Serial Number" and then read back the next line, which corresponds to what I want.Just so you know I have been using the reader.name command to find string tags which is great, but there are 4 in the file im looking at, I just need the one that says "Serial Number" as its content.
I have a function that queries the server to add items to a drop down list. Here is the excerpt in question:
While reader.Read() With f.items 'f is the drop down list object
[Code].....
I want to be able to use this same function over and over to populate all the drop down lists for the whole page, but am getting the error "column g.tostring not found". How do I get this to be handled as a variable string?
a text document containing information as:In/memory of/wendy/smith 6th of march 1545/ foreever in our thought/love liz and pony/i`ve got to develop a software in vb that will read the text file above and extract names, date.for each inscription it is required to display on a computer screen, IN TABULAR FORM, the details mention above.
I want to launch a application called Foxit Reader pdf Reader .I know System.Diagnostics.Process.Start(path) can do it but . Requirements are Foxit Reader should be installed on machine.Now if it is installed how to serarch for the path of its Executable to provide the parameter as I can not hardcode the path for different machines.
I am having an issue with both Adobe Reader and FoxIt Reader when trying to print a PDF document. Both issues are different but a solution to either one will allow me to fix my issue.The issue I am having with Adobe Reader when trying to print using the following code is that it will not print it to the network printer I specify but just the default printer.
Dim AdobeReader As New Process AdobeReader.StartInfo.CreateNoWindow = False AdobeReader.StartInfo.Verb = "print"
how would I accomplish saving a large piece of data, using the Stream Reader for the Line-by-Line, while keeping the carriage return line feeds in there?
Currently I am saving data from my applications by saving a text file via a stream reader as a string. I have come to a problem. In my current application, I have an array of the following structure:
So I am hacking together an app which listens to traffic using SharpPcap library, it reconstructs the packets from sessions using the code from TpcRcon.
Listening and reconstructing part work on their own . What I want is on each packet arrival main window gets an event so it can display the packet , and when session is reconstructed display a complete packet (I am interested in HTTP ones) . -That is where it breaks with weird symptoms: for example right now it does not stop on invoking stop listening method - the sharppcap library function hangs there forever waiting on this line of code : m_pcapThreadEvent.WaitOne();//wait for the 'stopped' signal from thread
I also had it not working and crashing in sharppcap function because I had omitted one parameter in form delegate- which makes no sense, because form delegate does not deal with packet capture at all and only reacts on "New Packet" event from my "Listener" class (which is only there to notify main form)
My app starts as module main instancing class "Listener". MainForm has it registered as friend with event and handles even "New Packet"
Main Form: Private Sub uiListenStart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btListenStart.Click aLogger.AddMessage("Started Listening")
I am currently rewriting a VBA XML reader to a VB.net version for a project. I have the following code in VBA:
Dim XML_Doc As Object: Set XML_Doc = CreateObject("MSXML2.DOMDocument") Dim XML_Detail As New ADODB.Recordset: XML_Detail.ActiveConnection = "Provider=MSDAOSP; Data Source=MSXML2.DSOControl.2.6;"
I was told that I should be able to use almost the exact code in my VB.Net version but I am running into some problems. I added as a reference to the VB.net project the Microsoft ActiveX 2.8 so I can use the ADODB.
The code in VB.Net is
Dim XmlDoc As Object : XmlDoc = CreateObject("MSXML2.DOMDocument") Dim XmlDetail As New ADODB.Recordset : XmlDetail.ActiveConnection = "Provider=MSDAOSP; Data Source=MSXML2.DSOControl.2.6;"
When running the application it gets to the XmlDetail and throws the following error:System.Runtime.InteropServices.COMException was unhandled. Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
I am attempting to read specific lines of GIANT text files (> 150 MB) with hundreds of thousands of lines. The files are contained on an FTP site. I can successfully open the files using FTPwebrequest and streamreader but to get to a specific line using streamreader, you have to read every line before it. Obviously this takes a lot of time when you need to get to the millionth line.
A much faster way, I think, would be to use filestream and the filestream.position function. However, I'm not sure how to open a file as a filestream from FTP. I have tried:
Dim ftpaddress as string = "ftp://####@ftp.textfile.asc+" Dim fileStream1 As New FileStream(ftpaddress, IO.FileMode.Open, IO.FileAccess.Read)
I've been developing a simple virus scanner and it works by reading the hex code of a file and comparing it to signatures from a database. Anyway, the only thing slowing it down is how it reads the hex. This is the hex reading part of my code so far:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LoadFile.Click Dim ArrayHold() As Byte Dim Index As Integer = 0 Dim Str As New StringBuilder
I'm looking forward to make a system using a BCode Reader. Like the way when a book has a correspond barcode and when it scan by a BCode reader the correspond info on the book will be showed in he system. So how to code the BCode reader and how it will determine the barcode of a book or what ever items that has a barcode?
How do I really use data reader in vb.net. I'm using odbc to connect mysql and vb.net. Function I declared on a module:
Public Function form2search(ByVal drugname As String) As OdbcDataReader cmd.CommandText = "SELECT * FROM drug WHERE Drug_name LIKE'%" & drugname & "' " Return cmd.ExecuteReader End Function [Code] .....
I see a result, but it only loads the first item on the database. I've put this code in the text_changed event. What's the proper way of doing this? And what's wrong with the 2nd code, why is it only loading the first data. As you can see the con is the module where I declared the function. Then I created an object of it in the form.
Using VB 2010 on W7 x64 and I'm getting the HID device registered OK but then I never get the WM_INPUT messages. I test it on x32 Vista and same thing... no WM_INPUTs.
In an older program I am now maintaining, a SQL query is issued and the results are fed in to a DataTable and accessed through a DataTableReader.I see lots of lines like:
myInt = CInt(dtr.getvalue(42))
What I want to know is, would this ever differ from:
myInt = dtr.getint32(42)
If there could be a difference, what would trigger it?
its possible to find out in a reader how much reading is left to do. My code will be below and i think it be fairly possible during a query that would be returning data but is it possible during a query designed to give data?
Public Function queryup(ByVal queryString As String, ByVal connection As MySqlConnection) Try Dim newQuery As String() = Split(queryString, ":") For Each Query In newQuery
When I am using an OleDBConnection to read a CSV, I notice something strange When the datasource (folder) of the CSV has a number in it, it will ALWAYS skip the header record, regardless of whether HDR=Yes or HDR=No
Dim conn As New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + input_path + ";Extended Properties='text;IMEX=1;HDR=YES;FMT=Delimited;ImportMixedTypes=Text'") Dim command As New OleDb.OleDbCommand("SELECT * FROM [" + input_csvFile + "]", conn) Dim da As New OleDb.OleDbDataAdapter(command) da.Fill(input).ToString()
I wanna make a time in and time out using a fingerprint device.. how can i start a coding for this in visual basic .net for attaching a device or accessing its database.
always had a problem getting my head around it. I don't have a very strong mental model of how the code flows. My main problem is i think i understand the syntax, but not really its application. Any links people found useful would be great.
Couple of questions. The code below doesn't make sense to me (written by someone else) the application is basically a csv reader, but manipulates the data. Public Sub entryType()
Are there any examples on how to implement a datareader? I have try copying the code from MSDN but;--"Dim reader as SQLDataReader = command. ExecuteReader()"Where it is placed? As a declariton at the beggining of a form? or as as VB resource?and then how those it bind a to a dataGridView? How can I loop through each rows once is bind to use the contents of the column/row?I can perform the above function easly inside of MS Access using VBA. I have gone through various books from WROX but none of them show a clear example or the code is obsolete.
I'm switching over from PHP to vb.net. And some of the concepts are a bit different. Mainly I struggle with concepts and keywords, so it hard to look stuff up. Currently I'm creating a dashboard and needs to run a lot of different sql queries. But I see where I should be able to minimize my code. But things that I have tired don't work. Example below of two chunks of code that I should be able to put in some type of loop and increment a value for my sqlstring and textbox output.