The following code should do the trick for you.
public Class Form1
Private Sub Form1_DragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles Me.DragDrop Dim formats As ICollection(Of String) = e.Data.GetFormats(True)
If (formats.Contains("FileDrop")) Then Dim files() As String = CType(e.Data.GetData("FileDrop", True), String()) End If
End Sub
Private Sub Form1_DragEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles Me.DragEnter e.Effect = DragDropEffects.All End Sub
End Class
Inside For1m_DragDrop the files() array contains the names of all the files that were dropped on the form in the current drop operation.
You can see an example of how to update data in a database by looking at the VB 2005 101 Code Samples, which you can access here: http://msdn.microsoft.com/vbasic/downloads/code/101samples/
-Scott Wisniewski
|