SqlConnection sqlconn = new SqlConnection(connectionstring);
DataTable dt=new DataTable();
sqlconn.Open();
dt = sqlconn.GetSchema("Tables");
foreach (System.Data.DataRow row in dt.Rows)
{
Response.Write(row["TABLE_NAME"] + "</br>");
}
sqlconn.Close();
[參考]http://www.douban.com/note/19535276/