本帖最后由 pengxiaoshuang0 于 2014-09-06 20:19:21 编辑

解决方案 »

  1.   

    你的sql语句只查了一张表 要显示其他两张首先sql语句要三表链接啊 如果不存在主外建关系用一个控件是显示不了的
      

  2.   

    2张表有没有关联字段,通过关联的字段写成联合查询,这样能把2张表中内容同时取出
    select a.s1,a.s2,b.s1,b.s3 from table where a.s1=b.s1
      

  3.   

    select a.s1,a.s2,b.s1,b.s3 from table1 a,table2 b  where a.s1=b.s1
      

  4.   

    利用Web用户控件实现站内搜索显示部分页面内容
    //输入要显示的文件内容
    <asp:TextBox ID="txtkey" runat="server" Width="240px" Height="20px"></asp:TextBox>//载入文本框
    <asp:DropDownList ID="ddltype" runat="server" Width="78px" CssClass="txt" 
                    Height="20px">//下拉框选择内容
                    <asp:ListItem>时政要闻</asp:ListItem>
                    <asp:ListItem>经济动向</asp:ListItem>
                    <asp:ListItem>世界军事</asp:ListItem>
                    <asp:ListItem>科学教育</asp:ListItem>
                    <asp:ListItem>法治道德</asp:ListItem>
                    <asp:ListItem>社会现象</asp:ListItem>
                    <asp:ListItem>体育世界</asp:ListItem>
                    <asp:ListItem>时尚娱乐</asp:ListItem>
                </asp:DropDownList>
    <asp:Button ID="cmdSearch" runat="server" Text="站内搜索" OnClick="cmdSearch_Click" Height="20px" />//处理事件按钮
    //进行处理显示
    protected void cmdSearch_Click(object sender, EventArgs e)
        {
            Session["tool"] = "都市新闻网络中心->站内查询("+ddltype.Text+")----输入关键字为"" + txtkey.Text + """;
            Session["search"] = "select * from tbnews where style='" + ddltype.Text + "'and content like '%" + txtkey.Text + "%' ";
            //and issueDate='" + DateTime.Today.ToString() + "'
            Response.Redirect("search.aspx"); 
        }
      

  5.   

    left join
    百度一下怎么用不知道你另外两张表是啥,也不知道3张表有啥关联