string strConnectionString =System.Configuration.ConfigurationManager.AppSettings["dbconn"];
using (SqlConnection connection = new SqlConnection(strConnectionString))
{
try
{
SqlCommand sqlcmd = new SqlCommand("SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE'", connection);
connection.Open();
SqlDataReader dr = sqlcmd.ExecuteReader();
while (dr.Read())
{
context.Response.Write(dr.GetString(0));
context.Response.Write("\n");
}
sqlcmd.Dispose();
}
catch (Exception e)
{
context.Response.Write(e.Message);
}
}
context.Response.Write("----------------------------");