473,385 Members | 2,243 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

DB Data Computer.Network.PING DO WHILE loop

17
Greetings All,

I have established a working Remote Connection to a MySQL DB using ODBC which allows me to select data in a Datagridview in my Form. The data is a list of IP addresses. What i want to do is take each IP address, parse it to My.Computer.Network.Ping if the result returns false then the IP address is diaplayed in a TextBox1. If the result is true then the IP address is either disgarded or displayed in another TextBox field.

Fairly simple IF ELSE statement which i think needs to be used in conjunction with a DO WHILE loop.

Due to thier being numerous IP addresses to Ping the loop would be placed in a seperate thread and the actual Ping arguements altered accordingly (timeout etc)

I think with this i need some direction is the best way to get started,

Any thoughts?

Thanks in advance as always,

Sy
Mar 25 '08 #1
5 2302
Plater
7,872 Expert 4TB
It seems like you have the right idea. (A seperate thread of sorts would be needed to keep things moving along)
You have the IP addresses.
You have the PING section available to you.
You know what to do for successfull pings and unsuccessfull pings


Just give it a shot and see what comes out.
I might suggest that use a "pool" of some number of threads, and some mechanism to feed them IP addresses as needed. But that is a bit overly complex at this point I thjink.
Mar 25 '08 #2
SyGC
17
It seems like you have the right idea. (A seperate thread of sorts would be needed to keep things moving along)
You have the IP addresses.
You have the PING section available to you.
You know what to do for successfull pings and unsuccessfull pings


Just give it a shot and see what comes out.
I might suggest that use a "pool" of some number of threads, and some mechanism to feed them IP addresses as needed. But that is a bit overly complex at this point I thjink.
Hi Plater,

yea im giving it a go as we speak. I think the issue at the moment is extracting the IP Addresses from the Datagridview to parse to the Network.Ping.

Anyway ill crack on! Any suggestions though feel free! :P

Sy
Mar 25 '08 #3
SyGC
17
Hi Plater,

yea im giving it a go as we speak. I think the issue at the moment is extracting the IP Addresses from the Datagridview to parse to the Network.Ping.

Anyway ill crack on! Any suggestions though feel free! :P

Sy
Hello All,

Ive been able to extract the IP Addresses from my data set and parse them to an array which in turn parses them to the Network.Ping method running in a WHILE loop in a seprate thread. Ive then pointed the the results from the Network.Ping method (True/False) displaying the IP address if returning False in a textbox field. However all i want to do is simply return line each time an IP address is parsed to a textbox field. Ive looked into using a list box but cannot get the IP addresses to be shown as its "items"

Expand|Select|Wrap|Line Numbers
  1. Dim resultip As String
  2. IpResListBox1.Items.IsReadOnly = resultip  
  3.  
Above this throws the error 'IsReadonly'

Expand|Select|Wrap|Line Numbers
  1. Dim resultip As String
  2. Pingable_Results_IP_TextBox1.Text = resultip
  3.  
Above returns the IP Address meeting the Ping arguement however doesnt return line and instead replaces the first IP Address with the second.

Any Thoughts? (Its so simple i know...ive had a bad week...if not a usual week)

Sy
Mar 29 '08 #4
balabaster
797 Expert 512MB
Hello All,

Ive been able to extract the IP Addresses from my data set and parse them to an array which in turn parses them to the Network.Ping method running in a WHILE loop in a seprate thread. Ive then pointed the the results from the Network.Ping method (True/False) displaying the IP address if returning False in a textbox field. However all i want to do is simply return line each time an IP address is parsed to a textbox field. Ive looked into using a list box but cannot get the IP addresses to be shown as its "items"

Expand|Select|Wrap|Line Numbers
  1. Dim resultip As String
  2. IpResListBox1.Items.IsReadOnly = resultip 
  3.  
Above this throws the error 'IsReadonly'

Expand|Select|Wrap|Line Numbers
  1. Dim resultip As String
  2. Pingable_Results_IP_TextBox1.Text = resultip
  3.  
Above returns the IP Address meeting the Ping arguement however doesnt return line and instead replaces the first IP Address with the second.

Any Thoughts? (Its so simple i know...ive had a bad week...if not a usual week)

Sy
Set your textbox to multiline. The textbox can now be populated as an array of string - check out the example below:
Expand|Select|Wrap|Line Numbers
  1. Dim MyStrings() As String = New String() {"Line1", "Line2", "Line3", "Line4"}
  2. TextBox1.Lines = MyStrings
The other way is a listbox...you can't just set the listbox to show the items in that fashion.
For instance
Expand|Select|Wrap|Line Numbers
  1. Dim MyList As List(Of Item)
  2. ListBox1.Items = MyList
won't work...and will result in your readonly error.
However:
Expand|Select|Wrap|Line Numbers
  1. For Each sItem As String in MyList
  2.   ListBox1.Items.Add oItem
  3. Next
will work just fine.
Mar 30 '08 #5
Plater
7,872 Expert 4TB
You could use DataGridView and use your DataSet as the DataSource.
Then cycle through your DataTable (instead of pushing them to another array) and just update a 2nd column about if it could ping the address or not.
Mar 31 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Paul Wagstaff | last post by:
Hi there folks, Within Access 97, Can anyone tell me the proper way to 'ping' a workstation on a NT 4 network and/or gather data such as the IP adress. Currently I have code and use...
1
by: Ciro | last post by:
Hi Guys, I'm developing an application that sends ICMP echo requests (ping) via the .net Ping Class. I've some informations related to the network such as IP addresses,Urls,SiteNames and so stored...
38
by: Tom | last post by:
I need my data generating C program on computer #1 to export small amounts of data (one - 40 byte data structure) periodically (once per minute) to a C program on computer #2. I am considering...
5
by: =?Utf-8?B?bWFydGluMQ==?= | last post by:
Hi, All, I try to ping another PC using ping in vb 2005, can anyone provide a snippet of code? Thanks in advance, Martin
6
by: MattPKaiser | last post by:
I am trying to find a way to check if a computer on a network is "online" so that I can access a file on a share. In short I maintain a list of computers that have my service running (in the...
10
by: Charlie of Bolton | last post by:
Hi, I have to below script, and everything seems to work except that if I entered the Primary IP and Secondaries IP, with such number; 10.100.1.11 or 10.10.10.245 the last numbers of my IP...
3
by: SyGC | last post by:
Hi People, Im trying to do a simple Loop where by an IP address is pinged (Using My.computer.network.ping) and the results, true or false, are used to invoke another line of code. Basically if...
25
by: p byers | last post by:
Good Morning Folks I have a LAN Among the several connections to it are the following four devices: A MAXSTOR network Storage Device A PC running Microsoft Windows 2000 Server 5.0.2195 (SP4) A...
1
by: somsub | last post by:
Can any one help me on ping command . for this line of code ($ret, $duration, $ip) = $p->ping ($line) If i give any 1> invalid entry as a parameter ($line) in ping command or
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.