Hi,
Try this one,
Dim dsnNames As New List(Of String)
Dim reg As Microsoft.Win32.RegistryKey = Registry.LocalMachine.OpenSubKey("Software")
If reg IsNot Nothing Then
reg = reg.OpenSubKey("ODBC")
If reg IsNot Nothing Then
reg = reg.OpenSubKey("ODBC.INI")
If reg IsNot Nothing Then
reg = reg.OpenSubKey("ODBC Data Sources")
If reg IsNot Nothing Then
For Each dsn As String In reg.GetValueNames
dsnNames.Add(dsn & "-" & reg.GetValue(dsn))
Next
End If
End If
End If
End If
For Each Name As String In dsnNames
TextBox1.AppendText("DataSource Name: " & Name & Environment.NewLine)
Next Name
hope this may help you!!