my connection string is Initial Catalog=CompainDecumentation.MDF;Data Source=Localhost\SQLEXPRESS;Integrated Security=SSPI
when i take my project to another computer :
1. log file is missing (Solved by remove the .log and it create itself)
2. in the JIT it says Failed to connect to "X" (X is the Authentication name Like Migo-pc\Migo)
now, whats wrong in the connection string how to make it work everywhere
Note: C# Application Connected (ADO.Net) with SQl Server 2005 Express, when i go to the client i setup NetFrameWork 2.0, SQLserver Express, Sql Server Management studio Express. then i atach the .mdb AND i Expect the project work
You can't use Data Source=Localhost\SQLEXPRESS and expect it to work on the client's machine unless they have a SQLEXPRESS instance as well. Based on what you stated you need to change the connection string, on the client machine, to Data Source=localhost.
However, if you installed the SQL Server with a named instance, the string would look more like Data Source=localhost\INSTANCE_NAME, where INSTANCE_NAME is the name you gave it during the install.
Edit based on comments by OP: so at this point your only problem is this. Change the Initial Catalog=CompainDecumentation.MDF to Initial Catalog=CompainDecumentation, make sure you named the database CompainDecumentation, and finally, make sure you installed it in mixed-mode allowing for Windows authentication on the client machine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With