This link has been bookmarked by 1 people . It was first bookmarked on 17 Aug 2006, by Nilas Jensen.
How is this done? Well, to start with, ADO.NET adds a couple of new keywords to the ConnectionString. The ConnectionString is the set of parameters passed to ADO that tells it how to find and access the target data source, as well as identify the user. It also contains settings for a number of options, including how long to wait for the connection to complete and, in this case, the name of the user database to attach. This keyword (Attach-DBFilename) points to a user .MDF file which contains the preconfigured and prepopulated SQL Server database. When the ADO Open method sees this keyword, it tells SQL Server to attach this file and install it as a new databaseat least the first time. Each subsequent time the application runs, SQL Server determines if this is the same file it attached the first time and simply opens the existing database. When you use the default AutoClose option, SQL Server automatically disconnects from the data file when the last user closes his connection. This permits an uninstall application to delete the file and not disturb SQL Server.
Another ConnectionString option is used to create an entirely separate instance of the server. By specifying “User Instance=True” along with the “AttachDBFilename=
Page Comments
Would you like to comment?
Join Diigo for a free account, or sign in if you are already a member.