From within a terminal window, execute the following commands: sqllocaldb start MSSQLLocalDB sqllocaldb info MSSQLLocalDB
After getting the information of MSSQLLocalDB, fill the data source on the source code as the following statement Data Source =the information of MSSQLLocalDB;Database=databasename;Trusted_Connection=True;MultipleActiveResultSets=true