Create table news (msg varchar(50));
//defining connection objectOracleConnection cn = new OracleConnection("user id=scott;password=tiger;data source=ganesh1");//defining command objectOracleCommand cmd = new OracleCommand("select * from news", cn);//instantiating the string objectstring news = string.Empty;//opening the connectioncn.Open();//executing the statement(only one row is retrievednews = cmd.ExecuteScalar().ToString();//closing the connectioncn.Close(); //returning string Return "<marquee>" + news + "</marquee>";//code in page load //projecting textLabel1.Text = "cached time" + DateTime.Now.ToString();
<%@ OutputCache Duration ="10" VaryByParam ="none" %>