Exemple #1
0
        void SelectServerName()
        {
            try
            {
                txtServerName.Items.Clear();
                SqlDataSourceEnumerator instance = SqlDataSourceEnumerator.Instance;
                DataTable table = instance.GetDataSources();

                foreach (DataRow row in table.Rows)
                {
                    SqlServerList sqlSl = new SqlServerList {
                        ServerName = row[0].ToString(), InstanceName = row[1].ToString()
                    };
                    string sqlName;
                    if (string.IsNullOrEmpty(sqlSl.InstanceName))
                    {
                        sqlName = sqlSl.ServerName;
                    }
                    else
                    {
                        sqlName = sqlSl.ServerName + "\\" + sqlSl.InstanceName;
                    }
                    txtServerName.Items.Add(sqlName);
                }
            }
            catch
            {
            }
        }
Exemple #2
0
 public object Clone()
 {
     try
     {
         if (this == null)
         {
             return(null);
         }
         SqlServerList SqlSL = new SqlServerList {
             ServerName = ServerName, InstanceName = InstanceName, IsClustered = IsClustered, Version = Version
         };
         return(SqlSL);
     }
     catch
     {
         throw new NotImplementedException();
     }
 }
Exemple #3
0
 public object Clone()
 {
     try
     {
         if (this == null)
         {
             return null;
         }
         SqlServerList SqlSL = new SqlServerList { ServerName = ServerName, InstanceName = InstanceName, IsClustered = IsClustered, Version = Version };
         return SqlSL;
     }
     catch
     {
         throw new NotImplementedException();
     }
 }
Exemple #4
0
        void SelectServerName()
        {
            try
            {
                txtServerName.Items.Clear();
                SqlDataSourceEnumerator instance = SqlDataSourceEnumerator.Instance;
                DataTable table = instance.GetDataSources();

                foreach (DataRow row in table.Rows)
                {
                    SqlServerList sqlSl = new SqlServerList { ServerName = row[0].ToString(), InstanceName = row[1].ToString() };
                    string sqlName;
                    if (string.IsNullOrEmpty(sqlSl.InstanceName))
                        sqlName = sqlSl.ServerName;
                    else
                        sqlName = sqlSl.ServerName + "\\" + sqlSl.InstanceName;
                    txtServerName.Items.Add(sqlName);
                }
            }
            catch
            {

            }
        }