protected void Page_Load(object sender, EventArgs e) { cn.Open(); cmd = new SqlCommand("Select * from house", cn); dr = cmd.ExecuteReader(); DataList1.DataSource = dr; DataList1.DataBind(); cn.Close(); cn.Open(); cmd = new SqlCommand("Select * from room", cn); dr = cmd.ExecuteReader(); DataList2.DataSource = dr; DataList2.DataBind(); cn.Close(); cn.Open(); cmd = new SqlCommand("Select * from hall", cn); dr = cmd.ExecuteReader(); DataList3.DataSource = dr; DataList3.DataBind(); cn.Close(); cn.Open(); cmd = new SqlCommand("Select * from ground", cn); dr = cmd.ExecuteReader(); DataList4.DataSource = dr; DataList4.DataBind(); cn.Close(); }
private void blog() { string mainconn = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString; SqlConnection sqlConnection = new SqlConnection(mainconn); string sqlquery = "select top 3 [BlogName],[BlogerName],[BlogPic] from [dbo].[BlogUpdate]"; SqlCommand sqlCommand = new SqlCommand(sqlquery, sqlConnection); sqlConnection.Open(); SqlDataAdapter sda = new SqlDataAdapter(); sda.SelectCommand = sqlCommand; DataSet ds = new DataSet(); sda.Fill(ds); DataList3.DataSource = ds; DataList3.DataBind(); sqlConnection.Close(); }
public void LoadDB() { pds.DataSource = bll.Show(txt_number.Text); pds.AllowPaging = true; pds.PageSize = 9; pds.CurrentPageIndex = Pages; if (pds.IsFirstPage && pds.IsLastPage) { link_previous.Enabled = false; link_next.Enabled = false; } else if (pds.IsFirstPage) { link_previous.Enabled = false; link_next.Enabled = true; } else if (pds.IsLastPage) { link_previous.Enabled = true; link_next.Enabled = false; } else { link_previous.Enabled = true; link_next.Enabled = true; } pagecount = pds.DataSourceCount; lbl_page.Text = "当前是" + (pds.CurrentPageIndex + 1).ToString() + "页 共有" + pds.PageCount.ToString() + "页 "; DataList3.DataSource = pds; DataList3.DataBind(); }
protected void DataList1_ItemCommand(object source, DataListCommandEventArgs e) { int catID = Convert.ToInt32(e.CommandArgument); //Gridview.DataSource = DAO.getAllProductsByCatID(catID); if (DAO.getProductPaging(catID, 1).Rows.Count > 0) { Gridview.DataSource = DAO.getProductPaging(catID, 1); Session["CateID"] = ""; Session["CateID"] = catID; GetListPage(DAO.GetTotalRows(catID)); DataList3.DataSource = listPage; DataList3.DataBind(); Gridview.DataBind(); Label1.Text = ""; } else { Label1.Text = "Not found Data of this Category!"; Gridview.DataSource = null; Gridview.DataBind(); Session["CateID"] = null; DataList3.DataSource = null; DataList3.DataBind(); } }
public void helpmenus() { DataTable dty = select("SELECT MainMenuName FROM MainMenuMaster where MainMenuId='" + Request.QueryString["MainMenu"].ToString() + "'"); if (dty.Rows.Count > 0) { mainmenu.Text = dty.Rows[0]["MainMenuName"].ToString(); DataTable dt = select("SELECT SubMenuName, SubMenuId FROM SubMenuMaster where MainMenuId='" + Request.QueryString["MainMenu"].ToString() + "'"); if (dt.Rows.Count > 0) { DataList3.DataSource = dt; DataList3.DataBind(); foreach (DataListItem gvbn in DataList3.Items) { Label id = (Label)gvbn.FindControl("Label17"); DataList dl = (DataList)gvbn.FindControl("DataList4"); DataTable page = select("SELECT PageTitle, PageId FROM PageMaster where MainMenuId='" + Request.QueryString["MainMenu"].ToString() + "' and SubMenuId='" + id.Text + "'"); if (page.Rows.Count > 0) { dl.DataSource = page; dl.DataBind(); } } } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { getAbot(); dlNews.DataSource = SystemMgr.BLL.Common.GetDataReader("select top 5 * from News where TypeName='新闻公告' order by id desc "); dlNews.DataBind(); dlXinDe.DataSource = SystemMgr.BLL.Common.GetDataReader("select top 5 * from News where TypeName='教学大纲' order by id desc "); dlXinDe.DataBind(); DlZN.DataSource = SystemMgr.BLL.Common.GetDataReader("select top 5 * from News where TypeName='课程习题' order by id desc "); DlZN.DataBind(); dlKC.DataSource = SystemMgr.BLL.Common.GetDataReader("select top 5 * from News where TypeName='文献参考' order by id desc "); dlKC.DataBind(); DataList1.DataSource = SystemMgr.BLL.Common.GetDataReader("select top 12 * from FileInfo order by id desc "); DataList1.DataBind(); DataList2.DataSource = SystemMgr.BLL.Common.GetDataReader("select top 12 * from Video order by id desc "); DataList2.DataBind(); DataList3.DataSource = SystemMgr.BLL.Common.GetDataReader("select top 4 * from Video order by Addtime asc "); DataList3.DataBind(); } }
protected void info() { try { int c = 1; string str = "select top 10 * from product where _ischeap=" + c + ""; DataSet ds = DB.dataSet(str); DataList1.DataSource = ds.Tables[0]; DataList1.DataBind(); /*----------------- hot--------------*/ string str2 = @"select * from product where _id in (select top 10 _proid from orderdetail group by _proid order by sum(_count) )"; DataSet ds2 = DB.dataSet(str2); DataList2.DataSource = ds2.Tables[0]; DataList2.DataBind(); /*----------------- time--------------*/ string str3 = "select top 10 * from product order by _id desc"; DataSet ds3 = DB.dataSet(str3); DataList3.DataSource = ds3.Tables[0]; DataList3.DataBind(); } catch { } }
private void LoadSpeciality(string docMail) { DataTable dt = dManager.GetDoctorbasicInfo(docMail); DataList3.DataSource = dt; DataList3.DataBind(); }
public void Bind3() { string sql = "select top 5 * from News order by NewsID desc"; DataList3.DataSource = OperateDB.ExecuteDataSet(sql); DataList3.DataBind(); }
private void PageInit() { if (Request["OrderID"] != null && Request["OrderID"] != "") { orderids = Request["OrderID"]; WX.WorkOrder.Order.MODEL porder = WX.WorkOrder.Order.NewDataModel(Request["OrderID"]); Title_li.Text = porder.Title.ToString(); Proj_li.Text = WX.WorkOrder.Order.ProjStr[porder.Proj.ToInt32()]; Type_li.Text = WX.WorkOrder.Order.TypeStr[porder.Type.ToInt32()]; YJTime_li.Text = porder.YJTime.ToString(); StateTime_la.Text = WX.CommonUtils.GetRealNameListByUserIdList(porder.UserID.ToString()) + " " + porder.AddTime.ToString(); SubTime_li.Text = porder.SubTime.ToString(); FPTime_li.Text = porder.YSTime.ToString(); StopTime_li.Text = porder.StopTime.ToString(); State_li.Text = WX.WorkOrder.Order.StateStr[porder.State.ToInt32()]; state = porder.State.ToInt32(); Remarks_li.Text = WX.WorkOrder.Order.EnCoding(porder.Remarks.ToString()); Button2.Visible = false; if (porder.State.ToInt32() == 7) { Button2.Visible = true; } DataList3.DataSource = ULCode.QDA.XSql.GetDataTable("select dept.Name DeptName,wdept.DeptID,worder.* from WorkOrder_Dept wdept left join WorkOrder_Orders worder on wdept.WID=worder.ID left join TE_Departments dept on wdept.DeptID=dept.ID where worder.State>0 and wdept.WID=" + Request["OrderID"] + " order by AddTime desc"); DataList3.DataBind(); //if (porder.State.ToInt32() > 1) //{ MessBind(); mess.Visible = true; AppBind(); pingjiafs.Visible = true; pingjiafs.Width = "418px"; //} } }
private void showtv() { DataTable dt = db.selectquery(" select top 5(p.pid),p.img,p.productname,p.category,b.brand,p.rate from Product p join brand b on p.brand = b.Bid where p.category='4' ORDER BY pid ASC"); DataList3.DataSource = dt; DataList3.DataBind(); }
private void GetData(string emp) { DataTable dt_wk = new DataTable(); DataTable dt_my_1 = new DataTable(); DataTable dt_my_2 = new DataTable(); DataTable dt_my_3 = new DataTable(); string sql = @"exec [usp_app_emp_login_list] '{0}','{1}'"; sql = string.Format(sql, _workshop, emp); dt_wk = SQLHelper.Query(sql).Tables[0]; dt_my_1 = SQLHelper.Query(sql).Tables[1]; dt_my_2 = SQLHelper.Query(sql).Tables[2]; dt_my_3 = SQLHelper.Query(sql).Tables[3]; DataList1_M.DataSource = dt_wk; DataList1_M.DataBind(); //Label1.Text = Label1.Text + "(" + dt_wk.Rows.Count + ")"; DataList2.DataSource = dt_my_1; DataList2.DataBind(); Label2.Text = Label2.Text + "(" + dt_my_1.Rows.Count + ")"; DataList3.DataSource = dt_my_2; DataList3.DataBind(); Label3.Text = Label3.Text + "(" + dt_my_2.Rows.Count + ")"; DataList4.DataSource = dt_my_3; DataList4.DataBind(); Label4.Text = Label4.Text + "(" + dt_my_3.Rows.Count + ")"; }
protected void Page_Load(object sender, EventArgs e) { Data_con dc = new Data_con(); SqlConnection con = dc.SQL_con(); con.Open(); SqlDataAdapter da1 = new SqlDataAdapter("SELECT top 13 * FROM [Down_2] where soft_type='软件更新' ", con); DataSet ds1 = new DataSet(); da1.Fill(ds1, "Down_2"); con.Close(); DataList1.DataSource = ds1; DataList1.DataBind(); SqlDataAdapter da2 = new SqlDataAdapter("SELECT top 13 * FROM [Down_2] where soft_type='手机软件' ", con); DataSet ds2 = new DataSet(); da2.Fill(ds2, "Down_2"); con.Close(); DataList2.DataSource = ds2; DataList2.DataBind(); SqlDataAdapter da3 = new SqlDataAdapter("SELECT top 13 * FROM [Down_2] where soft_type='单机游戏' ", con); DataSet ds3 = new DataSet(); da3.Fill(ds3, "Down_2"); con.Close(); DataList3.DataSource = ds3; DataList3.DataBind(); }
public void databind() { con.Open(); SqlCommand com2 = con.CreateCommand(); com2.CommandText = "Select Item_Id,Image,MRP,SalePrice,Item_Name from dbo.Item Where Featured = @y and Active = @y and In_Stock-Out_Stock > 0"; com2.Parameters.AddWithValue("@y", "yes"); dadapter1 = new SqlDataAdapter(com2); dset1 = new DataSet(); adsource1 = new PagedDataSource(); dadapter1.Fill(dset1); con.Close(); if (dset1.Tables[0].Rows.Count != 0) { adsource1.DataSource = dset1.Tables[0].DefaultView; adsource1.PageSize = 2; adsource1.AllowPaging = true; adsource1.CurrentPageIndex = pos1; btnPrevious1.Visible = !adsource1.IsFirstPage; btnNext1.Visible = !adsource1.IsLastPage; DataList3.DataSource = adsource1; DataList3.DataBind(); } else { fea.Visible = false; //H2.Visible = false; //btnNext1.Visible = false; //btnPrevious1.Visible = false; //DataList3.Visible = false; } }
protected void Page_Load(object sender, EventArgs e) { List <nsgaanamania.clstbsgsdataprp> k = obj.find_rec_ctg_sgs(Convert.ToInt32(Request.QueryString["ctgid"])); DataList3.DataSource = k; DataList3.DataBind(); }
public void LoadMenuDB() { PagedDataSource pds = new PagedDataSource(); pds.DataSource = bll.Show(txt_number.Text); pds.AllowPaging = true; pds.PageSize = 12; pds.CurrentPageIndex = PageMenu; if (pds.IsFirstPage && pds.IsLastPage) { link_down.Enabled = false; link_up.Enabled = false; } else if (pds.IsFirstPage) { link_up.Enabled = false; link_down.Enabled = true; } else if (pds.IsLastPage) { link_up.Enabled = true; link_down.Enabled = false; } else { link_up.Enabled = true; link_down.Enabled = true; } DataList3.DataSource = pds; DataList3.DataBind(); }
private void recent() { string review = "SELECT * FROM Products Order By DOR DESC"; SqlConnection conn = new SqlConnection(lines); SqlCommand cmd = new SqlCommand(review, conn); conn.Open(); SqlDataAdapter da = new SqlDataAdapter(cmd); DataSet ds = new DataSet(); da.Fill(ds); totalrows2 = ds.Tables[0].Rows.Count; DataTable dt = ds.Tables[0]; PagedDataSource pg = new PagedDataSource(); pg.DataSource = dt.DefaultView; pg.AllowPaging = true; pg.CurrentPageIndex = currentposition2; pg.PageSize = 3; btn_first2.Visible = !pg.IsFirstPage; btn_prev2.Visible = !pg.IsFirstPage; btn_next2.Visible = !pg.IsLastPage; btn_last2.Visible = !pg.IsLastPage; //Binding pg to datalist DataList3.DataSource = pg; DataList3.DataBind(); conn.Close(); }
protected void DataList3_ItemCommand(object source, DataListCommandEventArgs e) { if (e.CommandName == "PageNumber") { CurrentPage = Convert.ToInt32(e.CommandArgument); //int id = Convert.ToInt32(DropDownList1.SelectedValue); int id = Convert.ToInt32(Session["CateID"]); GetListPage(DAO.GetTotalRows(id)); DataList1.DataSource = DAO.getAllCategories(); DataList1.DataBind(); DataList3.DataSource = listPage; DataList3.DataBind(); Gridview.DataSource = DAO.getProductPaging(id, CurrentPage); Gridview.DataBind(); } //if (e.CommandName == "Category") //{ // Session["CateID"] = Convert.ToInt32(e.CommandArgument); // GetListPage(DAO.GetTotalRows(Convert.ToInt32(Session["CateID"]))); // DataList1.DataSource = DAO.getAllCategories(); // DataList1.DataBind(); // DataList3.DataSource = listPage; // DataList3.DataBind(); // Gridview.DataSource = DAO.getProductPaging(Convert.ToInt32(Session["CateID"]), CurrentPage); // Gridview.DataBind(); //} }
protected void Page_Load(object sender, EventArgs e) { SqlCommand komut = new SqlCommand("Select * From Tbl_Hakkimizda", bgl.baglanti()); SqlDataReader oku = komut.ExecuteReader(); DataList3.DataSource = oku; DataList3.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { SqlCommand komut = new SqlCommand("select *from Tbl_Yemekler", bgl.baglanti()); SqlDataReader dr = komut.ExecuteReader(); DataList3.DataSource = dr; DataList3.DataBind(); }
void docMau() { string data_mau = "Select * from tbMAUSP"; DataList3.DataSource = cm.getTable(data_mau); DataList3.DataBind(); }
private void Logo() { LienKet a = new LienKet(); DataTable da = a.Logo(); DataList3.DataSource = da; DataList3.DataBind(); }
public void Top5Prouduct() { DataTable dt = new DataTable(); dt = bus.ShopTop5Product(); DataList3.DataSource = dt; DataList3.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { SqlCommand cmd = new SqlCommand("SELECT * FROM Tbl_Yemekler where Durum=1", bgl.baglanti()); SqlDataReader dr = cmd.ExecuteReader(); DataList3.DataSource = dr; DataList3.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { SqlCommand cmd = new SqlCommand("Select * from TabloYemekler where durum=1", bgl.baglanti()); SqlDataReader oku = cmd.ExecuteReader(); DataList3.DataSource = oku; DataList3.DataBind(); }
public void bind_camp_update() { DataSet ds = new DataSet(); ds = db.ExecuteDataSet("select * from tbl_camp_update"); DataList3.DataSource = ds.Tables[0]; DataList3.DataBind(); }
public void productInfor() { int id = Int32.Parse(Request.QueryString["productid"]); DataTable dt3 = new DataTable(); dt3 = bus.productinfor(id); DataList3.DataSource = dt3; DataList3.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { Panel2.Visible = false; SqlCommand cmd = new SqlCommand("Select *From Tbl_Mesajlar", bgl.baglanti()); SqlDataReader dr = cmd.ExecuteReader(); DataList3.DataSource = dr; DataList3.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { int a = int.Parse(Request.QueryString["mid"].ToString()); int b = 1; { string chuoi = "Select cateID,newsid,title,DESCRIPTION,content,picture,createdate FROM News WHERE cateID = '" + a + "' AND active ='" + b + "'"; DataList3.DataSource = db.GetTable(chuoi); DataList3.DataBind(); } }
public void getdata() { DataList1.DataBind(); DataList2.DataBind(); DataList3.DataBind(); DataList4.DataBind(); DataList5.DataBind(); DataList6.DataBind(); DataList7.DataBind(); }