My Project doesn't Run on Foreign Machine

hi everybody ...
i want ur help about this problem ...
i created a tiny project of Company Stores and it's run very well on my Computer, But when i run it on another computer, this message appears .

( A network-related or instance-specific error occurred while establishing a connection
to SQL Server. The server was not found or was not accessible.
Verify that the instance name is correct and that SQL Server is configured to allow
remote connections. (provider; Named Pipes provider, error: 40 - Could not open a connection
to SQL Server )

or this

( An attempt to attach an auto-named database for file ( Folder path\xCompany.mdf )
failed. A database with the same name exists, or specified file cannot be opened,
or it is located on UNC share. )

But, when i put my EXE and ( database files mdf & ldf ) in this folder ( C:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA ) the program runs very well.

-- i want run my application in any client machine without any problems and without move my application files to previous folder...

( This is my ConnectionString i used in App.Config File )

Data Source=(local);AttachDbFilename=|DataDirectory|\xCompany.mdf;
Integrated Security=SSPI"

Thanks a lot ...

0 answers