protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string str_sql; str_sql = "SELECT top 20 hot,leixing,id,title+'('+format(shijian,'mm-dd')+')' as biaoti FROM news where leibie = '新闻' order by shijian asc,id asc"; DataView dv = DBFun.GetDataView(str_sql); GV_news.DataSource = dv; GV_news.DataBind(); Session["dv_news"] = dv; //更改数据库数据类型 //str_sql = "alter table cpry alter column cdrw_gg_khyx1 varchar(255)"; //DBFun.ExecuteSql(str_sql); //str_sql = "alter table cpry alter column cdrw_gg_khcz1 varchar(255)"; //DBFun.ExecuteSql(str_sql); //str_sql = "alter table cpry alter column cdrw_gg_khyx2 varchar(255)"; //DBFun.ExecuteSql(str_sql); //str_sql = "alter table cpry alter column cdrw_gg_khcz2 varchar(255)"; //DBFun.ExecuteSql(str_sql); str_sql = "select * from cpry"; DataTable dt = DBFun.dataTable(str_sql); if (!dt.Columns.Contains("score_zj")) { str_sql = "alter table cpry add COLUMN score_zj double;"; DBFun.ExecuteSql(str_sql); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string str_sql; str_sql = "SELECT top 10 hot,leixing,id,iif(len(title)>23,left(title,22)+'…',title)+'('+format(shijian,'yyyy-mm-dd')+')' as biaoti FROM news where leibie = '新闻' and leixing='0' order by shijian asc,id asc"; DataView dv = DBFun.GetDataView(str_sql); GV_news.DataSource = dv; GV_news.DataBind(); Session["dv_news"] = dv; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string str_sql; str_sql = "SELECT top 8 hot,leixing,id,title+'('+format(shijian,'mm-dd')+')' as biaoti FROM news where leibie = '新闻' order by shijian desc,id desc"; DataView dv = DBFun.GetDataView(str_sql); GV_news.DataSource = dv; GV_news.DataBind(); Session["dv_news"] = dv; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string strqry = "select url From t_dict where flm=8 and bm=11"; if (Convert.ToDateTime(DBFun.ExecuteScalar(strqry)) <= DateTime.Now) { Response.Write(@"<script>alert('评审截止日期已到!');window.history.go(-1);</script>"); return; } string str_sql; str_sql = "SELECT top 10 hot,leixing,id,iif(len(title)>23,left(title,22)+'…',title)+'('+format(shijian,'mm-dd')+')' as biaoti FROM news where leibie = '新闻' and leixing='2' order by shijian asc,id asc"; DataView dv = DBFun.GetDataView(str_sql); GV_news.DataSource = dv; GV_news.DataBind(); Session["dv_news"] = dv; } }