I need a relative path for my SQL DB but I get some errors. Could somebody help me? The errors are on the bolded lines.
SqlConnection con = new SqlConnection("Data Source=|DataDirectory|\\MFdb.mdf");
string executable = System.Reflection.Assembly.GetExecutingAssembly().Location;
string path = System.IO.Path.GetDirectoryName(**executable**);
**AppDomain.CurrentDomain.SetData("DataDirectory", path);**