During BizTalk map definition, sometime you might require to read some configuration value. For example, during use of database related functoids, you have to make connection string configurable. You can use BizTalk config file and scripting functoid to handle such scenario.
Here is what you need to do -
- Open "BTSNTSvc.exe.config" file from "drive:\Program Files\Microsoft BizTalk Server 2006 ".
- Add configuration setting there such as -<appSettings> <add key="CONNSTR" value="Data Source=SQL-SERVER;Initial Catalog=SAMPLE_DB;Integrated Security=SSPI"/> </appSettings>
- In map file, drag and drop script functoid and write following inline c# script. public string GetConnectionString()
- While using any database related functoid, drag output of script functoid as input in database functoid. And do not forget to put it in correct parameter sequence. That’s it.
One more last thing, you cannot test config value in map at design time because configuration values are read BTS host at runtime.