PDA

View Full Version : Msi.Install.ActiveDatabase.OpenExecute(sql);



fishyj
10-28-2013, 11:44 AM
Hello,

I'm trying to find out how I can populate a ListBox using the results from a managed custom action (C#).

I have found OpenView & OpenExecute, but I'm having problems with the SQL syntax.

Below is a brief code snippet....

string[] aStr = svrs.Split(',');
string sql = "DELETE FROM ListBox WHERE Property = 'GENERIC_LIST_ITEM'";
install.ActiveDatabase.OpenExecute(sql);
int idx = 0;
foreach (string s in aStr)
{
idx++;
sql = "INSERT ListBox (Property, Order, Value, Text) VALUES ('GENERIC_LIST_ITEM', idx, s, s)";
install.ActiveDatabase.OpenExecute(sql);
}


Looking at the MSI log I think the custom action aborts part way through, but I only know this as earlier logs (before using OpenExecute) have information in them that is now missing.

fishyj
10-31-2013, 06:24 AM
:nudge: Any one got any suggestions?

fishyj
11-01-2013, 07:41 AM
Anyone know the answer to this? :confused: