Show Sql Server Instance On The Network In ASP.NET Web Forms
The key is the SqlDataSourceEnumerator to display all instances. You can use gridview or ajax controls for display purposes.
protected void Page_Load(object sender, EventArgs e) { // Retrieve the enumerator instance and then the data. SqlDataSourceEnumerator instance = SqlDataSourceEnumerator.Instance; System.DataDataTable table = instance.GetDataSources(); // Display the contents of the table. DisplayData(table); } private void DisplayData(System.DataDataTable table) { foreach (System.DataDataRow row in table.Rows) { foreach (System.DataDataColumn col in table.Columns) { Response.Write(String.Format("{0} = {1}<br>", col.ColumnName, row[col])); } } }
I am learning Asp.Net Development. Can you provide me more information regarding "sql server" and "SqlDataSource".
ReplyDeleteHi anna,
Deletethere are tons of resources in the internet for sql server and sql datasource.
You could start at Microsoft's asp.net website. Aside from that, there are customized tutorials for your needs.
Cheers! ;)