The "Next" button has the following four Published Actions:
-> a connection string for ODBC connection is built:Set installer property value [SqlConnectionString] to Driver=[\{]SQL Server[\}];Server=[SQLSERVER];Uid=[SQLUSER];Pwd=[SQLPASS]
-> the Test ODBC connection action is executed (this action correctly throws an error whenever I try to login with wrong or empty username and password)
-> the following C# custom action is executed:
Code: Select all
public static ActionResult ReplaceConnectionString(Session session)
{
if (session["SQLUSERTYPE"] == "Admin") {
session["CONNSTRUSER"] = "myusername";
session["CONNSTRPASS"] = "mypassword";
} else {
session["CONNSTRUSER"] = session["SQLUSER"];
session["CONNSTRPASS"] = session["SQLPASS"];
}
return ActionResult.Success;
}Now, if my custom code had successfully been executed, [CONNSTRUSER] and [CONNSTRPASS] would contain something, right?
Either the fixed string, or the strings that were used for "Test ODBC Connection".
Because, during installation, the following should be added to the Web.config XML file:
user id=[CONNSTRUSER];password=[CONNSTRPASS];server=[SQLSERVER];database=[SQLDB];connection timeout=5
Until last week, all the four properties were correctly included in the connection string.
Then, I added a child dialog to the SQL connection dialog; which contains an RTF document with information how to correctly connect to SQL server.
Ever since, username and password are empty strings in Web.config.
So, it seems that the custom action is not executed, and my question is: Why?
FOLLOW US
Get the latest news in Application Packaging