none
Reuse .XSD in different project RRS feed

  • General discussion

  • I'd like to reuse a typed dataset (.XSD and related files) in a different project.  I copied the files to the new project directory and added them to the project.  Build fails because of the embedded references to the connection string in the prior project's Settings.  It looks like to reuse the source, it is necessary to manually edit the XML in the XSD file to change the references.  Either that or use the designer interface to change the connection string setting for each Tableadapter.  This seems like a major obstacle to code reuse.  Is there a better way?

     

    Edit:  It's not so bad.  All you have to do is add a connection string to the Settings in the new project and edit the reference at the top of the .xsd file: kk

     <Connections>
      <Connection AppSettingsObjectName="Settings" 
       AppSettingsPropertyName="OldConnectionString"
       IsAppSettingsProperty="true" Modifier="Assembly" 
       Name="OldConnectionString (Settings)" 
       ParameterPrefix="@" 
     PropertyReference="ApplicationSettings.OldAppName.Properties.Settings.GlobalReference.Default.OldConnectionString"
       Provider="System.Data.SqlClient" />
    </Connections>
    
    

    If the new connection string in Settings has the same name as "OldConnectionString", you need only change the OldAppName in the reference.  If it has a different name, just do a global replace of OldConnectionString with the new name.

     


    • Changed type kaborka Thursday, June 30, 2011 10:46 PM Resolved
    Thursday, June 30, 2011 9:49 PM