Hi,
I have a program which I require to work on a computer with no network. When Publishing the application it works perfectly on all networked computers but will not on the target computer without.
I am new to programming and would like some advice on how to achieve this. I have pasted a piece of code underneath.
Thanks:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim MyConnectionString As String = "Data Source=LUKEBETTLES-PC;Initial Catalog=ImageLocs;User Id=test;Password=test;Pooling=False"
Dim PumpPath As String
Using conn As New SqlConnection(MyConnectionString)
Using Command As New SqlCommand("SELECT PumpLoc FROM Locs", conn)
conn.Open()
PumpPath = Command.ExecuteScalar().ToString
txtPart.Text = Command.ExecuteScalar().ToString
conn.Close()
End Using
End Using
'txtPart.Text = "Pumps"
cmbImages.DataSource = IO.Directory.GetFiles(PumpPath).Select(Function(file) IO.Path.GetFileName(file)).ToList()
I have a program which I require to work on a computer with no network. When Publishing the application it works perfectly on all networked computers but will not on the target computer without.
I am new to programming and would like some advice on how to achieve this. I have pasted a piece of code underneath.
Thanks:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim MyConnectionString As String = "Data Source=LUKEBETTLES-PC;Initial Catalog=ImageLocs;User Id=test;Password=test;Pooling=False"
Dim PumpPath As String
Using conn As New SqlConnection(MyConnectionString)
Using Command As New SqlCommand("SELECT PumpLoc FROM Locs", conn)
conn.Open()
PumpPath = Command.ExecuteScalar().ToString
txtPart.Text = Command.ExecuteScalar().ToString
conn.Close()
End Using
End Using
'txtPart.Text = "Pumps"
cmbImages.DataSource = IO.Directory.GetFiles(PumpPath).Select(Function(file) IO.Path.GetFileName(file)).ToList()