Hi,
Use following code to get installed sql server instances to login. You need to use your servername as MachineName\\SQLInstanceName to login.
string[] InstanceNames = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Microsoft\\Microsoft SQL Server\\Instance Names\\SQL").GetValueNames();
string ServerName = string.Empty;
foreach (string str in InstanceNames)
{
ServerName = string.Empty;
ServerName = string.Concat(System.Environment.MachineName, "\\", str);
MessageBox.Show(LoginName);
}