Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to read .mst(transform) Table along with .msi
    primarykey
    data
    text
    <p>mst + .msi table information. </p> <p>I created following function to read msi Tables</p> <pre><code>// This method returns all rows and columns of a Table specified by Name public DataTable ReadMsiTableByName(string msiFile, string tableName) { DataTable msiTable = new DataTable(tableName); Database database = null; View view = null; try { using (database = new Database(msiFile, DatabaseOpenMode.ReadOnly)) { string sqlQuery = String.Format("SELECT * FROM {0}", tableName); view = database.OpenView(sqlQuery); view.Execute(null); Record record = view.Fetch(); ColumnCollection columnCollection = view.Columns; for (int i = 0; i &lt; columnCollection.Count; i++) { string columnName = columnCollection[i].Name.ToString(); System.Type columnType = columnCollection[i].Type; msiTable.Columns.Add(columnName, columnType.UnderlyingSystemType); } while (record != null) { DataRow row = msiTable.NewRow(); for (int i = 0; i &lt; columnCollection.Count; i++) { string type = columnCollection[i].Type.ToString(); if (type == "System.String") { row[columnCollection[i].Name.ToString()] = record.GetString(columnCollection[i].Name.ToString()); } else if (type == "System.Int16") { row[columnCollection[i].Name.ToString()] = record.GetInteger(columnCollection[i].Name.ToString()); } else if (type == "System.Int32") { row[columnCollection[i].Name.ToString()] = record.GetInteger(columnCollection[i].Name.ToString()); } else if (type == "System.IO.Stream") { System.IO.Stream stream; stream = record.GetStream(columnCollection[i].Name.ToString()); row[columnCollection[i].Name.ToString()] = stream; } } msiTable.Rows.Add(row); record = view.Fetch(); } } } catch (Exception ex) { CommonFn.CreateLog(ex.ToString()); } finally { if (database != null) database.Close(); if (view != null) view.Close(); } return msiTable; } </code></pre> <p>However I am unable to read .mst with this function. I read that you need to use msi transform for it, But I don't want to change the content of msi or mst, I just need to read all the tables. Please point me in right direction. Thanks in Advance :) </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload