Get a List of Software Installed on Your PC with a Single Line of PowerShell

Get a List of Software Installed on Your PC with a Single Line of PowerShell.

Advertisements

“Operation must use an updateable Query” error when updating Excel

 

Make sure that your connection string does not have “IMEX=1” in it.

private void UpdateEmailSent( string apexId ) {
            try {
                string excelConnectionString = string.Format( "Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0};Extended Properties=\"Excel 12.0 Xml;HDR=YES\";", lmiUserFileTextBox.Text );
                System.Data.OleDb.OleDbConnection MyConnection;
                System.Data.OleDb.OleDbCommand myCommand = new System.Data.OleDb.OleDbCommand( );
                string sql = null;
                MyConnection = new System.Data.OleDb.OleDbConnection( excelConnectionString );
                MyConnection.Open( );
                myCommand.Connection = MyConnection;
                sql = string.Format( "UPDATE [Sheet1$] SET [Email Sent] = 'X' WHERE [APEXID]='{0}'", apexId );
                myCommand.CommandText = sql;
                myCommand.ExecuteNonQuery( );
                MyConnection.Close( );
            } catch ( Exception ex ) {
                MessageBox.Show( ex.ToString( ) );
            }
        }