日期:2014-05-16  浏览次数:20338 次

<script>的一个模糊查询SQL数据库的
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="inquires.aspx.cs" Inherits="WebAppRD.CH.inquires" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
  <title></title>

</head>
  <body style="background: none">
  <form id="dataForm" runat="server">
  <table width="100%" border="0" cellpadding="2" cellspacing="1">
  <thead>
  <tr class="title">
  <td align="center"> 
  <p> <input type="text" value="请输入搜索的关键字" style="width:180px;" />
  <asp:ImageButton ID="submit" ImageUrl="themes/skin/searchBtn.jpg" runat="server" onclick="submit_Click" />
  </p>
  </td>
  </tr>
  </thead>
  <tbody align="center">
  <asp:ListView ID="listViewText" runat="server">
  <LayoutTemplate>
  <asp:PlaceHolder ID="itemPlaceholder" runat="server"></asp:PlaceHolder>
  </LayoutTemplate>
  <ItemTemplate>
  <tr class="listA" align="center">
  <td> <li><a href="txtCont.aspx?id=<%= Request["id"] %>&uid=<%# Eval("uid") %>&newsId=<%#Eval("id")%>">
  <%# Eval("title_CH") %></a><span><%# Eval("addTime") %></span></li> </td>
  </tr>
  </ItemTemplate>
  </asp:ListView>

   
  </tbody>
  </table >
  <div class="page" align="center" >
  <asp:DataPager runat="server" ID="dataPager" PagedControlID="listView" PageSize="15">
  <Fields>
  <asp:NextPreviousPagerField FirstPageText="首页" ShowFirstPageButton="True" ShowNextPageButton="False" ShowPreviousPageButton="False" />
  <asp:NumericPagerField />
  <asp:NextPreviousPagerField LastPageText="尾页" ShowLastPageButton="True" ShowNextPageButton="False" ShowPreviousPageButton="False" />
  </Fields>
  </asp:DataPager>
  </div>
  </form>
</body>
</html>

是想查询 数据库RD的表txtList 里的title_CH 字段 查出来后能显示到listViewText 里 谁帮我写个《script》 呀 非常感谢

------解决方案--------------------
额 不会