Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27412

how to connect to db table and then loop thru values?

$
0
0
Hi,

I have a very simple vb.net program that uses psexec from the shell command to exec a program remotely. Works fine - here's all the code:

Code:

Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Shell("C:\pstools\psexec.exe \\ZSW-ROBCON -i -u WSIHQ\Administrator -p M3rl1n ""C:\Program Files (x86)\G4SGS\Time Reminder Installer\Time Reminder.exe""")
    End Sub

End Class

The above works fine but now what I need to do is connect to SQL2005 table and read in the machine names from that table and pass them into my shell statement.

I'm new at this and don't know how to make a connection to the table and then (step two) replacing 'ZSW-ROB' with the machine names from that table.

So when completed - I need to execute my program remotely for every machine that's in my SQL table. Hope that makes sense.

Viewing all articles
Browse latest Browse all 27412

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>