I try to get all the SQL instance names on the machine, all the values are stored in regkey here, this is my code, but I continue to get an exception with a link to the link.
private void RegLoop()
{
RegistryKey key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names\SQL")
foreach (var v in key.GetValueNames())
{
MessageBox.Show("{0}", v);
}
}
source
share