public intro()
{
conn=dbconnection.getconn();
conn.open();
cmd=new oledbcommand("select top 1 * from [intro]",conn);
try
{
oledbdatareader dr=cmd.executereader();
dr.read();
introcontent=dr.getvalue(1).tostring();
}
catch
{
introcontent="";
}
finally
{
cmd.dispose();
conn.close();
}
}
public void dispose()
{
if(conn.state==connectionstate.open)
conn.close();
conn.dispose();
gc.suppressfinalize(this);
}
}
调用是-------
using(intro it=new intro())
{
}
新闻热点
疑难解答