PDA

Click to See Complete Forum and Search --> : I need help on Registry class in .NETto display all the ODBC User DSN


CodeMaker
Jun 13th, 2007, 02:29 AM
Hi
I need help on Registry class in .NET.

I need to display all the ODBC User DSN, in my login screen, so that they can select the DSN and connect to the database. I heard it can be done using Registry class. Kindly help me to do so.


Thank you

jmcilhinney
Jun 13th, 2007, 02:41 AM
You use the Microsoft.Win32.Registry and RegistryKey classes to access the registry in .NET code. As for if and where ODBC DSN data may be found in the registry, that's not really a C# issue. Once you know how to use those classes you can access any value in any key. Which keys and values you access are up to you.

CodeMaker
Jun 13th, 2007, 04:13 AM
Hi
i am using following code in VB

Private Declare Function SQLDataSources Lib "odbc32.dll" _
(ByVal hEnv As Long, _
ByVal fDirection As Integer, _
ByVal szDSN As String, _
ByVal cbDSNMax As Integer, _
pcbDSN As Integer, _
ByVal szDescription As String, _
ByVal cbDescriptionMax As Integer, _
pcbDescription As Integer) As Long


Now i am converting my project to asp.net

so i need help