Repository.ConnectToSQLRepository: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
<noinclude>{{Template:API}}{{Template:APIBreadcrumb|9, 10|.[[Repository Class|Repository]]}}</noinclude>
{{Template:API}}{{Template:APIBreadcrumb|.[[Repository Class|Repository]]}}




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


''DatabaseName''  
''DatabaseName''  
:String. The name of the database. (Required) 
:Required. String. The name of the database.


''UseImpersonation''
''UseImpersonation''
:Boolean. When true, indicates that the database requires SQL impersonation. Default value is false. (Optional)
:Optional. Boolean. Indicates whether the database requires impersonation. Default value = False.


''ImpersonateDomain''
''ImpersonateDomain''
:String. The domain for the impersonation. (Optional)
:Optional. String. The domain for the impersonation.


''ImpersonateUsername''
''ImpersonateUsername''
:String. The account username for the impersonation. (Optional)
:Optional. String. The account username for the impersonation.


''ImpersonatePassword''
''ImpersonatePassword''
:String. The account password for the impersonation. (Optional)
:Optional. String. The account password for the impersonation.




==Example==
==Example==
This example assumes that a SQL database named "MyEnterprise" exists in the C: drive. The code ignores the return value.
  '''VB|VB.NET'''
  '''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|"MyServer"}}, {{APIString|"MyDatabase"}})
</noinclude>

Latest revision as of 16:18, 17 June 2016

APIWiki.png


Member of: SynthesisAPI.Repository


Connects to a SQL Server repository. Returns a Boolean value; when true, indicates a successful connection to the repository.

Syntax

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

Parameters

ServerName

Required. String. The name of the SQL Server.

DatabaseName

Required. String. The name of the database.

UseImpersonation

Optional. Boolean. Indicates whether the database requires impersonation. Default value = False.

ImpersonateDomain

Optional. String. The domain for the impersonation.

ImpersonateUsername

Optional. String. The account username for the impersonation.

ImpersonatePassword

Optional. String. The account password for the impersonation.


Example

VB|VB.NET

Dim MyRepository As New Repository
MyRepository.ConnectToSQLRepository("MyServer", "MyDatabase")