This is similar to deploying Microsoft Access databases
Sample code from the 101 VB samples (VB101SamplesWinForms\UsingDataGridView)
on how to connect to MDF files have been added
======================================================
Dim connectStringBuilder As New SqlConnectionStringBuilder()
connectStringBuilder.DataSource = ".\SQLEXPRESS"
connectStringBuilder.AttachDBFilename = "C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\AdventureWorks_Data.mdf"
connectStringBuilder.IntegratedSecurity = True
connectStringBuilder.UserInstance = True
==========================================
Some very good links are as follows:
- http://weblogs.asp.net/jackieg/archive/2004/07/23/192255.aspx. Jackie's link also contains a link on how XCOPY works. This is also a good read
- http://msdn2.microsoft.com/en-us/library/ms165716.aspx . Also the named instances portion of the article is important
- http://msdn2.microsoft.com/en-us/library/ms143684.aspx has an article on User Instances. When we are setting the User Instance in the connection string to TRUE, we are using User Instances
No comments:
Post a Comment