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.

Sunday, 7 April 2013

Common English mistake using: Alumni

Singular male:     Alumnus
Plural male:        Alumni

Singular female:  Alumna
Plural female:     Alumnae


What about using the informal abbreviation for all?! ;)  Alum