示例#1
0
    protected void BindData2()
    {
        //IList lists = mgr.getTechInfoList(int.Parse(Request.QueryString["id2"].ToString()));
        //TechData.DataSource = lists;
        //TechData.DataBind();

        String       sql = "SELECT * from TechInfo where id=@param1";
        OleDbCommand cmd = new OleDbCommand(sql);

        cmd.Parameters.Add("@param1", OleDbType.Numeric).Value = Convert.ToInt32(Request.QueryString["id2"].ToString());
        cmd.CommandType = CommandType.Text;
        DataSet ds = SQLUtil.QueryDS(cmd);

        TechData.DataSource = ds;
        TechData.DataBind();
    }
示例#2
0
    private void BindData()
    {
        //at = SpringUtil.at();
        String sql = "SELECT r.*, p1.ParamName as pn1, p2.ParamName as pn2, p3.ParamName as pn3 FROM ReuseTech AS r, Param AS p1, Param AS p2, Param AS p3  ";

        sql += " WHERE id=@param1 and r.TechItem=p1.ParamCode And p1.ParamId='T' And r.WasteItem=p2.ParamCode And p2.ParamId='W' And r.ResearchItem=p3.ParamCode And p3.ParamId='R' ";
        //IDbParameters parameters = at.CreateDbParameters();
        //parameters.Add("param1", OleDbType.VarChar).Value = Request.QueryString["id"].ToString();
        //DataSet ds = new DataSet();
        //at.DataSetFillWithParameters(ds, CommandType.Text, sql, parameters);
        OleDbCommand cmd = new OleDbCommand(sql);

        cmd.Parameters.Add("@param1", OleDbType.VarChar).Value = Request.QueryString["id"].ToString();
        cmd.CommandType = CommandType.Text;
        DataSet ds = SQLUtil.QueryDS(cmd);

        TechData.DataSource = ds;

        TechData.DataBind();
    }