一分耕耘,一分收获

编程路上的成长与收获

 

2007年7月25日

全选gridView中的复选框


<asp:CheckBox ID="CheckAll" runat="server" Text="全选" OnCheckedChanged="selectAll" AutoPostBack="True" />

 protected void selectAll(object sender, EventArgs e)
    {
        //如果选中,则全选;否则,取消选择
        if (CheckAll.Checked == false)
        {
            for (int i = 0; i < GridView1.Rows.Count; i++)
            {
                CheckBox chk = (CheckBox)(GridView1.Rows[i].Cells[0].FindControl("ChBSelect"));
                chk.Checked = false;
            }
        }
        else
        {
            for (int i = 0; i < GridView1.Rows.Count; i++)
            {
                CheckBox chk = (CheckBox)(GridView1.Rows[i].Cells[0].FindControl("ChBSelect"));
                chk.Checked = true;
            }
        }
    }

posted @ 2007-07-25 16:44 如烟 阅读(228) 评论(2) 编辑

查询语句

关联表的写法
1.
select ... from a,b,c
where a... = b...
and c...= b...

2.
select * from (SELECT [hotelID], [hotelName], [hotelStar],
[CountryName]=(select C_Country_short from t_set_country where t_set_country.Country_Id=T_hotel.Country ),
[ProvinceName]=(select C_Province from t_set_province where t_set_province.Province_Id=T_hotel.Province ) ,
[CityName]=(select C_city from t_set_city where t_set_city.city_Id=T_hotel.City ),
[Postcode],[City],Country,Province, [hotelFax_Line], [hotelFaxCode], [hotelFax_AreaCode], [userCode], [hotelTele] FROM [T_hotel]) as tb";
where tb.Country='" + Request.QueryString["Id"] + "'

posted @ 2007-07-25 15:31 如烟 阅读(71) 评论(0) 编辑

导航

统计

公告