Click here to Skip to main content
15,884,176 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello,

AttachDbFileName=|DataDirectory|\abc.mdf;Database=abc, It's not running after the created .net windows application setup or exe,It's not running in to another system. I need Database name must,but it's not attaching, Database problem creating.

<connectionstrings>
<add name="GodrejInteriour.Properties.Settings.GodrejInterioConnectionString">
connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\abc.mdf;Database=abc;Integrated Security=True"
providerName="System.Data.SqlClient" />


<appsettings file="..\app.config">
<add key="ConnString" value="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\GodrejInterio.mdf;Database=abc;Integrated Security=True;User Instance=True">
<add key="ConnString1" value="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\GodrejInterio.mdf;Database=abc;Integrated Security=True">
<add key="ClientSettingsProvider.ServiceUri" value="">


Please help me.

Thanks.
Ankit
Posted

I need the error information.
AttachDbFileName=|DataDirectory|\abc.mdf;

1.You cant try change the reative address to absolute address.
e.g.
AttachDbFilename=E:\\directory\\abc.mdf
2.Check, whether the connection is available
3.You should login it by sql server type rather than windows type.
4.You can load the mdf into mssql,then use it.

Just try it!
 
Share this answer
 
Add prerequisite "SQL SERVER EXPRESS" in setup
Add abc.mdf file in setup
make sure abc.mdf is in same folder where your EXE file is placed after installation.

Happy Coding!
:)
 
Share this answer
 
|DataDirectory| is the pat in web structure, like ASP.NET
so it appears like ..\App_Data\abc.mdf
Instead of it you must during installation process change it to real DB path!
Also i'm not sure about .\SQLEXPRESS , do you really sure about it existance on remote machine ??
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900