1.点击搜索提交,获取搜索条件,用参数形式传递到那个新的页面.2.在新页面中,执行SQL,返回数据集合.3.与DataGrid绑定,显示数据.

解决方案 »

  1.   

    可以用ado.net里的oledb.net或者用sqlserver.net
    dim scon as string="provider=sqloledb.1;user id=sa;initial catalog=northwind;data source=myserver"
    dim mycon as new system.data.oledb.oledbconnection(scon)
    dim mycom as new oledbcommand("select * from customers",mycon)
    dim myreader as oledbdatareader
    mycon.open()
    myreader=mycom.executereader
    注意大小写,我只是打了一些,你可以改一改..
      

  2.   

    string commandText;
    OleDbConnection conn;
    string conStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+ Server.MapPath("bbs.mdb");
    conn = new OleDbConnection(conStr);
    if(e.CommandName=="Del")
    {
    commandText = "Delete from content where ID = " + e.CommandArgument;
    conn.Open();
    OleDbCommand comm = new OleDbCommand(commandText,conn);
    comm.ExecuteNonQuery();
      

  3.   

    页面一:
    string strDateTime = "你选择的时间"
    Response.Write("<script language='javascript'>location.href(新页面.aspx?DateTime="+strDateTime +"')</script>");
    显示页面:
    DataSet ds = new DataSet();
    string strSQL = "select * from 你的表 where DateTime=' "+Request["DateTime"];
    Sqlconnection sqlConn = new SqlConnection (你的连接字符传");
    SqlDataAdapter sqlAdpt = new SqlDataAdapter (strSQL,sqlConn);
    sqlAdpt.Fill(ds);
    this.DataGrid.DataSource = ds;
    this.DataGrid.DataBinding();
    注意大小写!
      

  4.   

    谢谢大家
    请问houlinghouling(新玲)怎样将那几个控件的值变成时间型的
      

  5.   

    先把3个值 组成字符串格式 str=“2003-11-14”然后 str.ToShortDateString()-----------努力学习 不断实践 虚心讨教---------
      

  6.   

    DateTime dt =new DateTime("1999-6-9") ; can get a datetime 's  object
      

  7.   

    ---sql procedure
    create procedure myFind
       @startDate varchar
       @endDate varcharas
      if (isdate(@StartDate) and isdate(@endData))=1
       Begin
          select * from  YourTable 
          where ‘开始日期’= convert(smallDateTime,@startdate)
            and  '结束日期'=convert(smallDateTime,@endDate)
        end begin   
    '以下为VB代码
    dim strSpName as string="myFind"
    dim mycn as string="provider=sqloledb.1;user id=sa;initial catalog=northwind;data source=myserver"
    dim mycon as new system.data.sqlclient.sqlconnection(scon)
    dim mycmd as new sqlcommand(strSPname,mycn)mycmd.CommandType=CommandType.StoredProcedure....................