Won't connect MDF file to WinForms on another PC

65 Views Asked by At

I use LocalDB (.MDF) for, VS 2022 community on PC1. I connected C# WinForms App to localdb .MDF file with OpenFileDialog and everything works on PC1, but I would like to run that WinForms App with same MDF file on PC2 without VS 2022. I transfered bin\Debug Folder to PC2.

PC2 error message:
Error Message Here is DB Connection Link (textBox1.Text is MDF file path): conn.ConnectionString = @"Data Source=(localdb)\MSSQLLocalDB; AttachDbFilename="+ textBox1.Text +"; Integrated Security=True;";

1

There are 1 best solutions below

0
Benjamin Saralidze On BEST ANSWER

Fixed. LocalDB wasn't installed.