Hi
I have got some code that returns a list of all applications installed on a PC. I am now trying to run it across all PC's on my network by loading all of my PC names into a SqlDataReader and then looping through that.
What I am finding is that the procedure is being called before the last one has finished - what is the best way to prevent this?
My code that calls it is as follows:
Thanks very much
Ed
I have got some code that returns a list of all applications installed on a PC. I am now trying to run it across all PC's on my network by loading all of my PC names into a SqlDataReader and then looping through that.
What I am finding is that the procedure is being called before the last one has finished - what is the best way to prevent this?
My code that calls it is as follows:
Code:
'Look up all live PCs and laptops
conn.Open()
strSQL = "SELECT bwbnet_Assets.AssetName " & _
"FROM bwbnet_Assets " & _
"WHERE (AssetType=1 OR AssetType=2) " & _
"AND OperationalStatus='LIVE' " & _
"ORDER BY AssetName ASC"
cmd.CommandText = strSQL
Dim readerID As SqlDataReader = cmd.ExecuteReader
While readerID.Read()
assetName = readerID.GetString(0)
lblStatus.Text = "Auditing " & assetName & "..." & Now.ToString
AuditPC(assetName)
End While
readerID.Close()
conn.Close()
Thanks very much
Ed