i have build my program with C# and the problem is that i use "Microsoft SQL Server Database File (SqlClient)" for my db and i wanted to make it portable because if i take all the project(sln) and give it to my friend to run it the database path is wrong of course..
So i have the database.mdf inside my directory of project C# so my question is, do you know a way to do it.
i have try to the connection string some patterns,
Data Source=.\SQLEXPRESS;AttachDbFilename="D:\blabla\blablaa\blablaaa\blablaaaa\WindowsFormsApplication2\WindowsFormsApplication2\WindowsFormsApplication2\WindowsFormsApplication2\Database1.mdf";Integrated Security=True;User Instance=True
so i did it like this
Data Source=.\SQLEXPRESS;AttachDbFilename="..\WindowsFormsApplication2\WindowsFormsApplication2\WindowsFormsApplication2\WindowsFormsApplication2\Database1.mdf";Integrated Security=True;User Instance=True
or
Data Source=.\SQLEXPRESS;AttachDbFilename="..\Database1.mdf";Integrated Security=True;User Instance=True
Any suggestions.