SPDatabase.GenerateRandomName Method
Generates a random database name using the specified connection string as a starting point.
Namespace: Microsoft.SharePoint.Administration
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No
Syntax
'Declaration
Public Shared Sub GenerateRandomName ( _
ByRef suggestedConnectionString As SqlConnectionStringBuilder _
)
'Usage
Dim suggestedConnectionString As SqlConnectionStringBuilderSPDatabase.GenerateRandomName(suggestedConnectionString)
public static void GenerateRandomName(
ref SqlConnectionStringBuilder suggestedConnectionString
)
Parameters
suggestedConnectionString
Type: System.Data.SqlClient.SqlConnectionStringBuilderA SqlConnectionStringBuilder object that contains the connection string.
Remarks
If the suggested name does not already exist, the suggestedConnectionString parameter is used for the database name; if the name is already being used, a GUID is appended to suggestedConnectionString to create the database name.