Hi, i have a program that connects with an sql database and it works fine with the sql. Now the problem comes when i publish. When i open the published program it gives me an error. An attempt to attach an auto-named database for file ..... A database with the same name exists, or specified file cannot be opened, or it is located on a UNC share.
the code for the sqlconnection:
public static SqlConnection conn = new SqlConnection(@"Data Source = .\SQLEXPRESS; AttachDbFilename= |DataDirectory|\dbRest.MDF; Initial Catalog = ; Integrated Security = SSPI; User Instance = False");