Query an Oracle Linked Server table from SQL Server

I have an Oracle Linked Table setup in my SQL Server database.  In order to query it’s internal tables (without needing to use OpenQuery), I use the following syntax:

[SQL]

SELECT * FROM [LinkedServerName]..[Schema].[TableName]

[/SQL]

Because the query is executed within SQL Server, you can use SQL Server-specific functions such as TOP, GetDate(), etc.  In order to pass a query directly to the Oracle table, using Oracle-specific functions/variables (TO_CHAR, SYSDATE, etc), and return the related dataset, use OpenQuery.

Show current line number in multiline textbox (C#)

I use the KeyUp and MouseUp events to trigger a quick lookup to show the current line number where the insertion point is in a multiline textbox.  In the following example, my multiline textbox is called txt_FileContents and I wrote a single method (UpdateCurrentLineNumber) that fetches the current line number, the total number of lines in the textbox, and then updates a label (lbl_LineNumber) to show the information.  Happy coding!

[csharp]

void txt_FileContents_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e)
{
UpdateCurrentLineNumber();
}

void txt_FileContents_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
{
UpdateCurrentLineNumber();
}

private void UpdateCurrentLineNumber()
{
int index = this.txt_FileContents.SelectionStart;
int line = this.txt_FileContents.GetLineFromCharIndex(index) + 1;

lbl_LineNumber.Text = ” Ln ” + line.ToString(“N0″) + ” / ” + this.txt_FileContents.Lines.Count().ToString(“N0”);
}

[/csharp]

Mirror drivers don’t support Aero effects

I noticed that my Windows 7 Aero effect was not enabled yesterday after an IT tech had DameWared to my PC to help with an issue I was having. When I went into the Control Panel and “Troubleshoot Aero Effects” option, I received the following error message: “Mirror drivers don’t support Aero effects” and the Troubleshooting dialog was unable to resolve the issue.

Aero Error

Aero Error

To resolve this, open your Device Manager, expand Display Adapters and Disable the “Dameware Development Mirror Driver 64-bit” driver.

Device Manager > Display Adapters

Disable Dameware Adapter

Click “Yes” to disable the device.

Click “Yes” to disable the device

Click “Yes” to restart your computer.

Click “Yes” to restart your computer

 

 

To stop DameWare from installing/using the MRC Mirror Driver, open DameWare Mini Remote Control, click the View menu, and choose Default Host Properties…

DameWare MRC Default Host Properties

Click on the Mirror Driver tab and UNCHECK the Use MRC’s Mirror Driver if available option.

Uncheck the “Use MRC’s Mirror Driver if available” option

Google+ (G+) Text Formatting

For BOLD text, use an asterisk (*) symbol at the beginning and end of a word (or words).

Example: *Google Plus Bold* = Google Plus Bold

For ITALICS, use an underscore (_) symbol at the beginning and end of a word (or words).

Example: _Google Plus Italics_ = Google Plus Italics

For STRIKETHROUGH, use a hyphen (-) symbol at the beginning and end of a word (or words).

Example: -Google Plus Strikethrough- = Google Plus Strikethrough

Speed-up Windows 7 Boot Time

Follow the below steps to make your Windows 7 PC boot faster.

Click your Start menu and type “msconfig” (without the quotes) and press Enter.

msconfig

msconfig

Click the Boot tab.

msconfig boot options

msconfig boot options

Click Advanced Options

msconfig advanced boot options

msconfig advanced boot options

Check the “Number of processors:” and “Maximum memory:” checkboxes, choose the number of processors in you PC, and select the maximum memory you want the boot process to utilize.

msconfig advanced boot options

msconfig advanced boot options

Click OK

Reboot your computer now or later to apply the changes.

msconfig restart to apply changes

msconfig restart to apply changes

Detect Double Right Mouse Click (VB.NET)

Simple Black Ops 2 countdown timer that’s triggered/dipslayed when the user double right-clicks the status bar in an application.  #easteregg

[vbnet]

Private Sub StatusStrip1_MouseDoubleClick(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles StatusStrip1.MouseDoubleClick
If e.Button = Windows.Forms.MouseButtons.Right Then
Dim dt_BO2Launch As Date = “11/13/2012 00:00:00”
Dim tspan As TimeSpan = dt_BO2Launch.Subtract(Now)
MessageBox.Show(tspan.Days & “:” & tspan.Hours & “:” & tspan.Minutes & “:” & tspan.Seconds & vbCrLf & “DD:HH:MM:SS”, “Time until Black Ops 2 Launch!”, MessageBoxButtons.OK, MessageBoxIcon.Asterisk)
End If
End Sub

[/vbnet]