|
-
May 18th, 2013, 08:08 AM
#1
Thread Starter
New Member
Connection string data source name
I have written my first app using a database. One of my connection string is as follows,
m_cn1.ConnectionString = "Data Source=.\SQLEXPRESS; AttachDbFilename = " & _
m_cn1mdfPath & ";Integrated Security=True; Connect Timeout=30;" & _
"User Instance=True"
I have installed this app on a few computers and all works well, but one.
My data source name on that PC is "SDCO".
My question is, is there a way to determine what the datasource name is and assign it to a string?
something like
public condatasourcename as string = my data source name on this PC
m_cn1.ConnectionString = "Data Source=.\" & condatasourcename & ; AttachDbFilename = " & _
m_cn1mdfPath & ";Integrated Security=True; Connect Timeout=30;" & _
"User Instance=True"
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|