用的是三层架构,提示我  guannian(数据交换层的)并不包含对InsertInfor定义,可是我明明都引用过来了啊
   protected void Button1_ServerClick(object sender, EventArgs e)
    {
        int studentid = Convert.ToInt32(Request.QueryString["id"]);
        string type = Request.QueryString["type"].ToString();
        string infor = this.infor.Value.ToString();
        GuanNian G = new GuanNian();
        G.Infor = infor;
        G.StudentID = studentid;
        G.Timer = Convert.ToDateTime(DateTime.Now.ToShortDateString());
        G.Type = type;
        guannian gn = new guannian();
        if(gn.InsertInfor(G)>0)
        {
            Response.Write("33");        }

解决方案 »

  1.   

           public int InsertInfor(GuanNian G)
           {
               StringBuilder sb = new StringBuilder();
               sb.Append("insert into [GunaNian](Student,Infor,Timer,Type)values(@studentid,@infor,@timer,@type)");
               SqlParameter[] parm ={ new SqlParameter("@studentid", SqlDbType.Int, 4), new SqlParameter("@infor", SqlDbType.NVarChar, 50),
               new SqlParameter("@timer", SqlDbType.DateTime,8),new SqlParameter("@type", SqlDbType.NVarChar, 50)};
               parm[0].Value = G.StudentID;
               parm[1].Value = G.Infor;
               parm[2].Value = G.Timer;
               parm[3].Value = G.Type;
               return SqlHelper.ExecuteNonQuery(SqlHelper.ConnectionStringLocalTransaction, CommandType.Text, sb.ToString(), parm);
           }
      

  2.   


    当我鼠标指到if(gn.InsertInfor(G)>0)  明明还是有调用这个类的提示的,怎么会这样啊