How to resolve LoaderLock Was Detected Error

Posted On // Leave a Comment
I try to use native WinSock in vb.NET but somehow i got "LoaderLock Was Detected" error. Follow the following step:

Open VS 2005. In the menu bar, go to Debug > Exceptions(Ctrl+Alt+E). You will find an Exception tree. Open 'Managed Debugging Assistants' > Loader Lock. Uncheck it



Check this kb article

Menangani Even DoubleClick Pada Devexpress GridView

Posted On // Leave a Comment

Penanganan double click pada DevExpress GridView ternyata tidak semudah yang saya bayangkan, karena harus memvalidasi apakah tempat kita doubleclick merupakan bagian dari suatu kolom/baris atau tidak.

setelah beberapa menit tanya ke mbah google, akhirnya nemu disini. Berikut script nya


Private Sub gridView1_DoubleClick(ByVal sender As Object, ByVal e As EventArgs) Handles GridView1.DoubleClick

        Dim view As GridView = CType(sender, GridView)

        Dim pt As Point = view.GridControl.PointToClient(Control.MousePosition)

        DoRowDoubleClick(view, pt)

    End Sub

    Private Shared Sub DoRowDoubleClick(ByVal view As GridView, ByVal pt As Point)

        Dim info As GridHitInfo = view.CalcHitInfo(pt)
        If info.InRow OrElse info.InRowCell Then

            Dim colCaption As String = ""
            If info.Column Is Nothing Then
                colCaption = "N/A"
            Else
                colCaption = info.Column.GetCaption
            End If

            MessageBox.Show(String.Format("Double click on row: {0}, column: {1}", info.RowHandle, colCaption))

        End If

    End Sub

Update Database From DevExpress GridControl

Posted On // Leave a Comment
After spend hours in google, finaly I got answer about how to update database when my GridControl is updated or inserted a new row. the code is really simple, but not as simple as find the right keyword to google it ;).

So here's the few code


Private Sub __UpdateMasterJasa(ByVal grid As DevExpress.XtraGrid.GridControl)

        Try
            'save the latest changes
            Dim view As ColumnView = grid.FocusedView
            If Not (view.PostEditor() And view.UpdateCurrentRow) Then Return

            'Update the database's Jasa table to which SQLDataAdapter DAMstJasa is connected
            DAMstJasa.Update(DS.Tables("MstJasa"))

        Catch ex As Exception

            MsgBox(ex.Message)

        End Try

    End Sub

Enjoy ;)