|
|
Visual Basic .NETSORGENTI - GESTIONE DELLE STRINGHE - CREARE UNA CONNECTION STRING A RUNTIME Function CreateConnString(Optional ByVal parentForm As Form = Nothing) As String Dim dataLink As Object = Microsoft.VisualBasic.Interaction.CreateObject("DataLinks") 'On Error Resume Next If Not parentForm Is Nothing Then dataLink.hWnd = parentForm.Handle.ToInt32() End If ' display the dialog Dim o As Object = dataLink.PromptNew() If o Is Nothing Then Return "" Else Return o.ConnectionString.ToString() End Function |