Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7712489
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T01:38:41+00:00 2026-06-01T01:38:41+00:00

When I run the following command, rKey has two values. RegistryKey sqlServer = Registry.LocalMachine.OpenSubKey(

  • 0

When I run the following command, rKey has two values.

RegistryKey sqlServer = Registry.LocalMachine.OpenSubKey( @"SOFTWARE\Microsoft\Microsoft SQL Server", false);

When I run either of the following commands (on the same machine as the same user) I find no values;

 RegistryKey sqlServer64 = RegistryKey.OpenBaseKey( RegistryHive.LocalMachine, RegistryView.Registry64);

   RegistryKey sqlServer32 = RegistryKey.OpenBaseKey( RegistryHive.LocalMachine, RegistryView.Registry32 );

Can anyone point me to the answer or a description of the hives vs plain registry access?

Edit:
What I do afterwards is :

 StringBuilder sbKeys = new StringBuilder();

  foreach (var key in sqlServer.GetValueNames() )
  {
       sbKeys.AppendLine( key );
  }

For all RegistryKeys. For sqlServer I see two Values, for sqlServer32 and SqlServer64 there are no values.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T01:38:42+00:00Added an answer on June 1, 2026 at 1:38 am

    The problem in your second variant is that you have failed to open a sub key. Your sqlServer.GetValueNames() call operates at the root level of a particular hive.

    You need it to be like this:

    RegistryKey root = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64);
    RegistryKey sqlServer = root.OpenSubKey(@"SOFTWARE\Microsoft\Microsoft SQL Server");
    foreach (var key in sqlServer.GetValueNames())
    { .... }
    

    Done this way it’s no different from your first variant (apart from the registry view). I expect that using the appropriate registry view will lead to the solution to your other question.

    Naturally you’ll want to add some error checking to the code above.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to run following command on SQL Server 2008 DB sp_OACreate 'SQLXMLBulkLoad.SQLXMLBulkload', @object
I run the following command in Emacs unsuccessfully C-u How can you clear the
I tried to run the following command and it says there is nothing to
If I run the following command: >python manage.py test Django looks at tests.py in
How can I run the following command using subprocess.Popen ? mysqldump database_name table_name |
Trying to run the following command in php to run powershell command... the following
I want to run the following command from a C program to read the
I've run the following command in the Ubuntu terminal - sudo apt-get install mono-develop
Normally if I run the following the following command in the rhino shell, mbp001:rhino1_7R2
I'm trying to run the following command: find . -iname '.#*' -print0 | xargs

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.