i have tried altering some code i have to ping an ip address and store the result in an access db.i had it working when i had the ip hardcoded in as a string but I am now gettin an error.instead of having the ip address hardcoded in to the code i want it to be read in from the access db but im now getting this error:System.nullreferenceExceptionbject reference not set to an instance of an object at...button1.click event args ei have underlined the piece of code i tried to change
vb Public Sub SendPing(ByVal strHostname As String, ByVal objSelectedNode As TreeNode) Try Dim objPing As New Ping
[code]....
My problem is that in this code (and I know it's a lame way to do it) I'm checking to see if the node is Green after the Ping has been completed to determine if the ping was successful. I would prefer to return a boolean value to be True if the ping was successful.
When it executes the SendPing on the DragDrop function, it starts that thread and executes the If statement to determine if the node is green, but the ping isnt complete. Now I have to do this function on many nodes at once, so I dont want this to be a single thread. Is it possible to return a value from an async call and then execute a function after that value has been returned, or will this have to be a single thread?
winform not webpage is it possible.i need to ping ip addresess from a list of items that are in an xml file and displayed in a datarepeater.and then return the response to a non-databound textbox inside each "record" in the datarepeater.i can ping fine if i hard code ip adresses into the program, but haven't been able to access anything inside the datarepeater.
just as a test i set a messagebox to give me the text of a label i have inside the repeater, even though on screen the label says server02 the message box shows the label.text as being "label15".
I have this little application that runs a SQL query works great, now I want to have a Start Button run the and display results then System.Threading.Thread.Sleep(300 * 1000) for 5 min then run again and display results and loop till I buttonstop_click. unsure if the sleep is the best method.
I would like to create a vb form with a combo box (with song title), a text box (for song lyrics), and a button (to submit or refresh). It is linked with an access database. The combo box is populated with the songTitle field in the db (this part works fine). The text box is populated with the lyrics that go to that song The first updates fine but I can not figure out how to run a query to pass to the text box's text property. I want the user to be able to select a song from the combo box, click the button, and have the text box populated with the new song's lyrics.
Any suggestions on how to accomplish this, or a good place for a tutorial that explains the necessary elements for having vb query a database and return the results?
I have been trying to get the Alert Code from my printer at work to see what exactly is happening however each time I send an SNMP query it doesn't return any results. I am using SimpleSNMP references. The printer is a Canon iR-ADV C5045.
This is how I call the function: Dim strAlertCode As String = SNMPQueryGet("1.3.6.1.2.1.43.18.1.1.7") This is the function: Private Function SNMPQueryGet(ByVal OID As String) Dim strResult As String = "True" Dim host As String = "192.168.1.202" [Code] .....
I am trying to get the html response of a Kayak.com query using a WebRequest object, however more often that not the site returns no results, i just get an empty Kayak page, i have to try the request around 5 times before i get a result back. What can be the cause of this? [Code]
If I can generate a list of random integer with a click of the button and put the results in a list box using VB.Net but how do I randomly change several integer number generated by button 1 by clicking button 2? How I retain the results of button1 and change the results when clicking button2?I try before but the two button function code cannot relate to one another.
So basically, I am running through my selected path recursively and returning the results to an array.. I think. vb.net Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim path As New FolderBrowserDialog If path.ShowDialog = Windows.Forms.DialogResult.OK Then Me.TextBox1.Text = path.SelectedPath [Code] .....
I was told that to return the search to an array, I add the return toarray() at the end. Now obviously Im not getting errors, but I am also not polling the results that are in fileslist.toarray(). I've looked at arrays quite a bit, I see their functionality if they are defined like myarray(4) with 5 declared array values... its an array with 5 value places. And to read from any one of the 5, you'd say something like msgbox(myarray(3)) to call the 3rd place in the array.
Well, as you can tell from the code, I am putting a variable amount of information into the array, How can I call that information? If I scanned a folder with 300 files, how can I call the results of that array and put them in a text file, or console, or messagebox through them? And assume I am doing it through a button click event. So, button click to read all input in the array to console or something like that.
Currently I have a gridview bound to a datatable which is populated with groups from the AD. I need to be able to add search functionality so users can type in part of a group name and have the results display only groups that fit their search criteria.
I'm using Visual Studio 2005, and I have a datagrid connected to a table from an Access database.
I added 4 textboxes so the user can type search filters to search within the table and a "search" button.
Then, I created a query using the "add query" tool on the datagrid. I wrote it like: select field1, field2, field3, field4, field5, field6 from table where field1=? and field2 like "%"+?+"%" and field3 like "%"+?+"%" and field4 like "%"+?+"%"
Both field5 and field6 aren't search criterias, so I didn't add them to the query. Once the query was created, I replaced the parameters inside the procedure with my textbox1.text, textbox2.text, textbox3.text, textbox4.text and then cut and pasted the whole thing inside my SEARCH button click event, so the query is executed when the user clicks on the button.
Now the problem is: when I search using the first field it goes ok, but when I try to search by any of the other fields it returns zero results, even though I double-checked I had written the words correctly. I don't know why it does this. I already tried deleting the datagrid and creating it again.[code]...
I am running a query in a thread but I can't figure out how to get the result back to the calling function. I am doing something like this:
Threading.ThreadPool.QueueUserWorkItem(AddressOf RunThread, "some query string") Private Function RunThread(ByVal stateInfo As Object) As String Dim myQuery As String = stateInfo.ToString
I am developing an ASPX web page to return results from two SQL stored procs via VB. When I execute these two stored procs, they both return valid data. But for some reason, when I run this report it doesn't return any errors, however, it doesn't return any records/data either!
Also, I can't debug it for some reason, although I can set breakpoints! This is using VS 2008, but I think reason I can't debug is I believe this is a limited version that just works for SSRS and SSIS.
[Code]...
Could the problem be due to the fact that this web page uses the same SQL connection for both stored procs? The first proc should be returned initially, and the second proc after this screen. So I don't need both stored procs information simultaneously, so I would think I could reuse the same SQL connection.
OK, I found where the problem is located. If I just comment out the Level statement in the Where clause, it does return data. So only thing I changed was that one line in my SQL code and it works. This means missing data must be due to datatype incompatibility, no? What is the problem?
[code] BUT, in code, watching the locals window for rec.EOF and rec.BOF both return true and therefore no results.Why does this work in VB Query Designer but not in code? If I remove the WHERE statement than the results return fine as expected.But its returning ALL of the results which is no good.
The following code works just fine: Dim wksSheetNames(0 To xlsWB.Worksheets.Count - 1, 0 To 1) As String Dim i As Integer = 0 For Each Wks In xlsWB.Worksheets Wks.Activate() wksSheetNames(i, 0) = xlsApp.ActiveSheet.codename [Code] .....
What is the best vb.net based search method that would permit me to search for i.e. "Sheet2" and be able to obtain "Cats"? I attempted to ascertain the index number of "Sheet1" with: Dim SheetArrIndex As Integer = Array.IndexOf(wksSheetNames, "Sheet1")
Then obtain the value "Cats" wksSheetNames(SheetArrIndex, 1)
But I received an error message: Code Line ->>>> "Dim SheetArrIndex As Integer = Array.IndexOf(wksSheetNames, "Sheet1")" Error msg ->>>> "Only single dimension arrays are supported here.: Obviously I do not know how to Search and Return the results of a 2D array.
I've got some code to try and loop through LINQ results, but it doesn't seem to be working.
HERE'S THE CODE
Public Sub ProcessRequest(ByVal context As System.Web.HttpContext) Implements System.Web.IHttpHandler.ProcessRequest ''# the page contenttype is plain text'
I can't think of a better way to do this, what i have is this function:
vb.net Function functionDealWithHiddenFields(ByVal HTML As String, ByVal numHiddenFields As Integer)
[Code].....
which usually contains: 4 so when i loop out the names, it loops the 4 results, 4 times, instead of just showing me the names 4 times so i can then store them
Trying to find some code to assist with accessing a web service. I am a newbie when it comes to web services and don't quite get the whole how to submit the request and then read the results. I know from searches that people request a copy of the WSDL file so I have attached (SystemManagementService.wsdl)
I am using the code shown below to compare two Access databases with two fields each and write the results to a third Access database. I am getting an error at the "Do While DMReader02.Read = True" line: "Invalid attempt to call Read when reader is closed." Why would the reader be closed at this point if I am using different DataReaders in the two loops?
Private Sub CopySelectedNodes(ByVal nodes As TreeNodeCollection) For Each node As TreeNode In nodes If node.Checked Then 'MessageBox.Show(node.FullPath) Me.CopySelectedNodes(node.Nodes) [Code] ..... This does not work, I want to loop through results so the textbox1 will be like 151,154,3,151, and I want to remove the last.
I have a listbox displaying sql results in a loop. Let's say I want to select one of those results and click a delete button. I have the button and box setup displaying the results just fine, I just do not have the functionality. How would I do that?
That was probably bad title, but I'll illustrate what I'm trying to do. I have a method in a class that I need to call several times. The method returns a List(Of String). I'm just grabbing some information from a database.
VB.NET Public Function GetTestList() As List(Of String) Dim int As Integer = 0