Repository.ConnectToSQLRepository: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
<noinclude>{{Template:API}}{{Template:APIBreadcrumb|9|[[Repository Class|Repository]]}}</noinclude>
<noinclude>{{Template:API}}{{Template:APIBreadcrumb|9, 10|.[[Repository Class|Repository]]}}</noinclude>
 


Connects to a SQL server repository that you specify. Returns a '''Boolean''' value; when true, indicates a successful connection to the repository.  
Connects to a SQL server repository that you specify. Returns a '''Boolean''' value; when true, indicates a successful connection to the repository.  
<noinclude>
<noinclude>
== Syntax ==
== Syntax ==
''object''.'''ConnectToSQLRepository(''ServerName'', ''DatabaseName'', ''UseImpersonation'', ''ImpersonateDomain'', ''ImpersonateUsername'', ''ImpersonatePassword'')'''
'''.ConnectToSQLRepository'''(''ServerName'', ''DatabaseName'', ''UseImpersonation'', ''ImpersonateDomain'', ''ImpersonateUsername'', ''ImpersonatePassword'')
 
===Parameters===
''ServerName''
:String. The server file path for the SQL database.(Required)


where ''object'' is a variable that represents a Repository object.
''DatabaseName''  
:String. The name of the database. (Required) 


===Parameters===
''UseImpersonation''
{| {{APITable}}
:Boolean. When true, indicates that the database requires SQL impersonation. Default value is false. (Optional)
|-
 
|ServerName{{APIParam|Required}}||'''String'''. The server file path for the SQL database.
''ImpersonateDomain''
|-
:String. The domain for the impersonation. (Optional)
|DatabaseName{{APIParam|Required}}||'''String'''. The name of the database.
 
|-
''ImpersonateUsername''
|UseImpersonation{{APIParam|Optional}}||'''Boolean'''. When true, indicates that the database requires SQL impersonation. Default value is false.
:String. The account username for the impersonation. (Optional)
|-
 
|ImpersonateDomain{{APIParam|Optional}}||'''String'''. The domain for the impersonation.
''ImpersonatePassword''
|-
:String. The account password for the impersonation. (Optional)
|ImpersonateUsername{{APIParam|Optional}}||'''String'''. The account username for the impersonation.
|-
|ImpersonatePassword{{APIParam|Optional}}||'''String'''. The account password for the impersonation.
|}




==Example==
==Example==
This example assumes that a SQL database named "MyEnterprise" exists in the C: drive. This code sample ignores the return value.
This example assumes that a SQL database named "MyEnterprise" exists in the C: drive. The code ignores the return value.
  '''VB|VB.NET'''<br>
  '''VB|VB.NET'''
  {{APIPrefix|Dim}} MyRepository {{APIPrefix|As New}} Repository
  {{APIPrefix|Dim}} MyRepository {{APIPrefix|As New}} Repository
  MyRepository.ConnectToSQLRepository({{APIString|"C:\Program Files\Microsoft SQL Server\"}}, {{APIString|"MyEnterprise"}})
  MyRepository.ConnectToSQLRepository({{APIString|"C:\Program Files\Microsoft SQL Server\"}}, {{APIString|"MyEnterprise"}})
</noinclude>
</noinclude>

Revision as of 17:24, 20 July 2015

APIWiki.png


Member of: SynthesisAPI9, 10.Repository


Connects to a SQL server repository that you specify. Returns a Boolean value; when true, indicates a successful connection to the repository.

Syntax

.ConnectToSQLRepository(ServerName, DatabaseName, UseImpersonation, ImpersonateDomain, ImpersonateUsername, ImpersonatePassword)

Parameters

ServerName

String. The server file path for the SQL database.(Required)

DatabaseName

String. The name of the database. (Required)

UseImpersonation

Boolean. When true, indicates that the database requires SQL impersonation. Default value is false. (Optional)

ImpersonateDomain

String. The domain for the impersonation. (Optional)

ImpersonateUsername

String. The account username for the impersonation. (Optional)

ImpersonatePassword

String. The account password for the impersonation. (Optional)


Example

This example assumes that a SQL database named "MyEnterprise" exists in the C: drive. The code ignores the return value.

VB|VB.NET

Dim MyRepository As New Repository
MyRepository.ConnectToSQLRepository("C:\Program Files\Microsoft SQL Server\", "MyEnterprise")