As Dave Kreskoviak mentioned in His answer, the error is very specific and easy to solve...
But... i need to warn you!
1)
Your code is
SQL Injection[
^] vulnerable!
Never use concatenated string as command text! Use
parameterized queries[
^] instead!
See:
How To: Protect From Injection Attacks in ASP.NET[
^]
How to: Execute a Parameterized Query[
^]
2)
I'd strogly recommend to
NOT use such of software on your database, because it kills database performance and might the reason of serious troubles. Imagine, you have a list of 10K computers. Your software produces 10K queries in few seconds, which searches and changes the data in your database. Everytime when new query is runing, your software creates new connection. So, 10K connections in few seconds - this remainds me an attack on SQL Server, which you execute on your wish. OMG! Your SQL server will stop responding or will start rejecting another connection.
Please, read this:
Security Monitoring and Attack Detection[
^]
Definition of a Security Vulnerability[
^]
Chapter 14 - Improving SQL Server Performance[
^] - old documentation, but very helpful in your case.
There's few possible solutions. One of them is:
Update your database on MS SQL server level using single update statement, for example:
UPDATE t1
SET t1.[Status] = t2.[Status]
FROM Computer AS t1 INNER JOIN ConnectedComputers AS t2 ON t1.CompName = t2.CompName
More at:
How to UPDATE from a SELECT in SQL Server? - Stack Overflow[
^]
By The Way! This might be helpful too:
Visual Representation of SQL Joins[
^]