connection string from a text file

ICW

Active member
Joined
Mar 27, 2006
Messages
25
Programming Experience
Beginner
:confused: Hi I have created a small data access app.
I want to pull the connection string for the SQL database from a text file. But I am getting it a bit wrong can anyone help at all

Dim connStr As String = ""
Dim SqlConnection1 As SqlConnection = New SqlConnection
Dim sr As New StreamReader("C:\Program Files\MDM\ScanViewSetUp\ConnectionString.txt")
connStr = sr.ReadLine()
SqlConnection1 = connStr
 
Back
Top