publishing an application for use on a computer with no network connection

bernard68

New member
Joined
Oct 13, 2009
Messages
1
Programming Experience
Beginner
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()
 
If the computer is not on the network, how would it connect to the required database in your connection string? If you have SQL server on that computer, may be restore a copy of the required database on that machine and use it.
 
Back
Top