ConfigurationHelperService.WriteConnectionStrings Method
Writes the connection strings to the specified configuration file after deleting any existing connection strings with the specified prefix.
Namespace: Microsoft.VisualStudio.Shell.Design.Serialization
Assembly: Microsoft.VisualStudio.Shell.Design (in Microsoft.VisualStudio.Shell.Design.dll)
Syntax
'宣告
Public Sub WriteConnectionStrings ( _
configFileName As String, _
configDocData As DocData, _
groupPrefix As String, _
connectionStrings As ConnectionStringSettingsCollection _
)
'用途
Dim instance As ConfigurationHelperService
Dim configFileName As String
Dim configDocData As DocData
Dim groupPrefix As String
Dim connectionStrings As ConnectionStringSettingsCollection
instance.WriteConnectionStrings(configFileName, _
configDocData, groupPrefix, connectionStrings)
public void WriteConnectionStrings(
string configFileName,
DocData configDocData,
string groupPrefix,
ConnectionStringSettingsCollection connectionStrings
)
public:
void WriteConnectionStrings(
String^ configFileName,
DocData^ configDocData,
String^ groupPrefix,
ConnectionStringSettingsCollection^ connectionStrings
)
member WriteConnectionStrings :
configFileName:string *
configDocData:DocData *
groupPrefix:string *
connectionStrings:ConnectionStringSettingsCollection -> unit
public function WriteConnectionStrings(
configFileName : String,
configDocData : DocData,
groupPrefix : String,
connectionStrings : ConnectionStringSettingsCollection
)
Parameters
- configFileName
Type: System.String
The target configuration file.
- configDocData
Type: Microsoft.VisualStudio.Shell.Design.Serialization.DocData
The working DocData.
- groupPrefix
Type: System.String
The section of the file where the connectionStrings should be written.
- connectionStrings
Type: System.Configuration.ConnectionStringSettingsCollection
ConnectionStringSettingsCollection.
Remarks
This first clears all existing strings in the groupPrefix section.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
See Also
Reference
ConfigurationHelperService Class