If you connect to local data, you can not only connect to a database file but also integrate it into your application. For example, you can open the Project menu, browse to an existing .sdf, .mdf, or .mdb file, and then add it to your project.
If you add local data files, you create a typed dataset and a dynamic connection string that points to the database file in your application. When you add a database file to your project, you use the Data Source Configuration Wizard to specify the objects to include.
You can automatically configure your connection and start the Data Source Configuration Wizard by dragging an .sdf, .mdf, or .mdb file from File Explorer into Solution Explorer. You can then specify the objects to use in your application.
If you use the Data Source Configuration Wizard to create the data source for a local data file, you are prompted to include the file in your project. If you don’t include it, your application will contain only the connection string to which the hard-coded path points, not the actual data file. For more information, see How to: Manage Local Data Files in Your Project.
After you complete the wizard, the database file and dataset appear in Solution Explorer/Database Explorer, and the database objects that you specified appear in the Data Sources window. By dragging items from the Data Sources window onto your form, you can create controls that are bound to the underlying data. To open the Data Sourceswindow, open the Data menu, and then choose Show Data Sources. For more information, see Binding Controls to Data in Visual Studio.