php - Multiple connection source for sql localdb -


i have winform application. using sql localdb. server connection string below;

string.format(@"data source=(localdb)\v11.0;attachdbfilename={0};integrated security=true", "c:\database\mydb.mdf"); 

i connect same db php pdo. installed sqsrv.dll etc. php , works. couldn't connect localdb when winform using it. codes below tried.

new pdo('sqlsrv:server=(localdb)\v11.0;attachdbfilename=c:\database\mydb.mdf;database=mydb', null, null); 

above codes give error "couldn't attach because mdf file using another..."

new pdo( 'sqlsrv:server=(localdb)\v11.0', null, null); 

above code give error "database object not found"

thank in advance.

new pdo('sqlsrv:server=(localdb)\v11.0;attachdbfilename=c:\database\mydb.mdf;database=mydb', null, null); 

above codes working if apache runs not service. may helps someone.


Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

gradle error "Cannot convert the provided notation to a File or URI" -

python - NameError: name 'subprocess' is not defined -