0
I have this link made to access there is local database, which using the executable on the computer where I created the application works and can access the database.
PUBLIC DAL()
{
_Sqlconn = new Sqlconnection(@"Data Source=(Localdb) Mssqllocaldb;Attachdbfilename=" + System.Windows.Forms.Application.Startuppath + @" staff.mdf;Integrated Security=True;Connect Timeout=30");
}
and my problem is that when I run the program on another computer from which it has not installed the visual studio it opens but does not find the database that is in the same folder as the executable.
Try : _Sqlconn = new Sqlconnection(@"Data Source=(Localdb) v11.0;Attachdbfilename="+System.Windows.Forms.Application.Startuppath+@" staff.mdf;Integrated Security=True;Connect Timeout=30");
– José Gomes
José Gomes thanks for the help but did not work with this change now nor access the database on the computer where it is to be created
– pedro7161
back to the previous code then and go to the database to find the link to it and put here please
– José Gomes
Data Source=(Localdb) Mssqllocaldb;Attachdbfilename=C: Users SOFIA Desktop INTERNSHIP Windowsformsapp1 Windowsformsapp1 bin Debug staff.mdf;Integrated Security=True;Connect Timeout=30
– pedro7161
supposedly this link is well done. write again because vs sometimes has bugs
– José Gomes
One of the reasons I think it doesn’t work is because the other computer doesn’t have any specific program to open the database
– pedro7161
if you have visual studio installed you can open the database without problem. What version of visual studio was the project created in? And what’s with the pc you’re trying to run?
– José Gomes
The version of the visual studio is 2017 and the goal is to pass the program to work to another computer that does not have the visual studio, the problem is that on the computer I want to pass that does not have the visual studio can not open the database to demonstrate and insert information in a datagrid view
– pedro7161
it usually works in the same
– José Gomes