I'm trying to create a SQL Server Project by automation. So I started prototyping using a Macro. I know the connection string for the project so I don't need that the "Add Database Reference" dialog appears. So I created my template with a connection string that after I need to set by automation.
2 issues:
1- When I use Solution.AddFromTemplate(...) the "Add Database Reference" appears. I suppose that the problem is that the ConnectionString is not stored in the csproj, it is stored in the csproj.user.
2- After I created the project the "Connection" properties does not belong to the project.Properties collection.
Is there a way to do this

Creating SQL Server Project by automation issues
RAS.Goss
thanks for following up and sharing how you worked around the issue!
much appreciated,
mike
dpighin82
I can't see a way to tell the VDT project flavor (vdtflav.dll) responsible for creating SQL server projects. vdtflav hooks into the VB/C# project systems. On creation of a new sql server project, the add database reference dialog will show up. Only if an existing project is being opened do they not show the add database reference dialog. Specifically, the IntializeforOuter method is being called with the CPF_CLONEFILE flag (create a new project based on an existing project template) then it will show the dialog. I can submit a feature request if you would like.
thanks!
mike
Wagner K.
I found a way to workaround this problem, I copy an existing sql project and after I use AddFromFile. After I'm modifying directly the .user file in order to change the connection string, ugly but it works ;)