Mike Eghtebas
asked on
Connection string...
I have an application with the following connection code where the database is uploaded to the application:
Question: How can I modify this code where (the database is not included with the application) the connection string is:
Data Source=.;Initial Catalog=WSCGSoftware;Integ rated Security=True
Thank you.
'*** Create a connection string with the connection string builder object
Dim conStrBldr As New SqlConnectionStringBuilder
With conStrBldr
.DataSource = ".\SQLExpress"
.AttachDBFilename = "NORTHWIND.MDF"
.IntegratedSecurity = True
End With
Question: How can I modify this code where (the database is not included with the application) the connection string is:
Data Source=.;Initial Catalog=WSCGSoftware;Integ
Thank you.
ASKER
You mean like:
Just use "app.path" as you have?
FYI, I also have: csWSCGSoftware.xml
'*** Create a connection string with the connection string builder object
Dim conStrBldr As New SqlConnectionStringBuilder
With conStrBldr
.DataSource = app.path & "\WSCGSoftware.mdf"
.IntegratedSecurity = True
End With
Just use "app.path" as you have?
FYI, I also have: csWSCGSoftware.xml
<?xml version="1.0" encoding="utf-8" ?>
<connection>
Data Source=.;Initial Catalog=WSCGSoftware;Integrated Security=True
</connection>
Yes, you tried to run? Error?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
i.e.
.datasource=app.path & "\your.mdf"