Monday, 27 May 2013

Remotely disconnect RDP (Remote Desktop Connection) Sessions

If your problem is the following dialog, then you are within the right hands.
Of course, required permissions are no question!

Command prompt:
>qwinsta /server:10.10.10.10
SESSIONNAME       USERNAME                 ID  STATE   TYPE        DEVICE
console                                    0  Conn    wdcon
rdp-tcp                                 65536  Listen  rdpwd
rdp-tcp#2         user 1                   1  Active  rdpwd

rdp-tcp#11        user2                    2  Active  rdpwd

- So, there are two logged in users with session IDs 1 & 2.
- To disconnect user with SessionID=2:
>reset session 2 /server:10.10.10.10

Wednesday, 22 May 2013

Tuesday, 21 May 2013

To maintain MS SQL column identity on delete

- Disable the identity for the specific column
- Delete
- Enable the identity for that same column



Thanks Dinos for the tip!

Sunday, 12 May 2013

A confusing French rule: des vs de


In front of a plural adjective, "de" is used instead of "des".

Par example:

Ce sont des arbres hauts.
Elle a de petits pieds.

Sunday, 21 April 2013

Feature I would like to see in: iOS 6, setting default browser

An option to open my links by default within other web browsers than Safari!

Cloning a row within data bound DataGridView


Me.HCDataSet.Tables("Hotels").ImportRow(HCDataSet.Tables("Hotels").Rows(Me.DGV_Hotels.CurrentRow.Index))
Me.HotelsBindingSource.MoveLast()
Dim o As DataRowView = (CType(Me.HotelsBindingSource.Current, DataRowView)) o.Row.SetAdded()


To commit the change:
Me.HotelsTableAdapter.Update(Me.HotelsBindingSource.DataSource)





Thanks Dinos for sharing!

Monday, 15 April 2013

Set default file-name to uploaded file name


    <script language="javascript" type="text/javascript">
        // Don't forget to set the textbox clientid=Static
        function Upload_FileChanged(filepath, TextBoxID) {
            var TextBox_AttachmentName = document.getElementById(TextBoxID);
            if (TextBox_AttachmentName != null) {
                if (TextBox_AttachmentName.value == "") {
                    if (filepath != null) {
                        var filename = filepath.replace(/^.*[\\\/]/, '')
                        TextBox_AttachmentName.value = filename;
                    }
                }
            }
        }
    </script>

Print Date and Time Using TSQL

PRINT LEFT(REPLACE(REPLACE(REPLACE(CONVERT(VARCHAR, GETDATE(), 121), '-','_'),':','_'),' ','_'), 16)

16 characters on the LEFT only to omit extra time details.