-
Notifications
You must be signed in to change notification settings - Fork 36
CreateSqlParameter Function
DbParameter CreateSqlParameter(sqlConnectionStringConfigKey:string, parameterName:string, parameterValue:object [, parameterDirection:string])
Creates a SqlParameter
or OdbcParameter
or DbParameter
object.
To use this function, first define a Connection String in the FIMService application config file (Microsoft.ResourceManagement.Service.exe.config) and restart the FIMService. Only Native SQL Server and ODBC .Net Framework data providers are supported. An example of Native SQL Server and ODBC connection strings is listed below:
<configuration>
<connectionStrings>
<add name="AuxDB" connectionString="Data Source=IDSYS.CONTOSO.COM;Initial Catalog=FIMAuxiliaryDB;Integrated Security=SSPI;" providerName="System.Data.SqlClient" />
<add name="AuxDB_ODBC" connectionString="DRIVER={SQL Server Native Client 11.0};SERVER=IDSYS.CONTOSO.COM;DATABASE=FIMAuxiliaryDB;Trusted_Connection=Yes;APP=MIMWAL;" providerName="System.Data.Odbc" />
</connectionStrings>
</configuration>
If the connection strings contain SQL User's password, it is highly recommended that you do not leave them unencrypted. The connection strings section can be encrypted using the helper script EncryptConnectionString.ps1
included in the project source code.
The parameter names must start with an "@".
If the optional direction parameter is omitted, the direction is assumed to be "Input". Possible values for the parameter direction are "Input", "Output", "InputOutput" and "ReturnValue".
Use CreateSqlParameter or CreateSqlParameter2 function to create parameters for the ExecuteSqlScalar and ExecuteSqlNonQuery functions.
2.17.0414.0
CreateSqlParameter("AuxDB","@FirstName", [//Target/FirstName])
CreateSqlParameter("AuxDB","@UniquenessKey", [//Value])
- MIMWAL Site - http://aka.ms/MIMWAL
- MIMWAL Releases - http://aka.ms/MIMWAL/Releases
- MIMWAL Documentation Wiki - http://aka.ms/MIMWAL/Wiki
- MIMWAL FAQ - http://aka.ms/mimwal/faq
- MIMWAL GitHub Code Repo - http://aka.ms/MIMWAL/Repo
- MIMWAL TechNet Q&A Forum (now read-only) - http://aka.ms/MIMWAL/Forum