ASP.NET获取MS SQL Server安装实例
[csharp]View Codeprotected void Page_Load(object sender, EventArgs e){DataTable dataTable = SqlDataSourceEnumerator.Instance.GetDataSources();foreach (DataRow dr in dataTable.Rows){if (string.IsNullOrEmpty(dr["InstanceName"].ToString()))this.DropDownListInstance.Items.Add(string.Concat(dr["ServerName"]));elsethis.DropDownListInstance.Items.Add(string.Concat(dr["ServerName"], "\\", dr["InstanceName"]));}}
补充:Web开发 , ASP.Net ,