plsql中查训出的数据显示value error_异步上传、保存路径、页面显示

​一、数据库设计

f99fe8454198679ea2fc62b369ea2724.png

二、Model实体类

public class banqi_attach  {       public int id { get; set; }       public string bqid { get; set; }       public string file_name { get; set; }       public string file_path { get; set; }       public int file_size { get; set; }       public DateTime create_time { get; set; }       public DateTime update_time { get; set; }  }

三、DAL数据访问层:注意涉及增加和根据id获取列表用于显示

//增加数据       public int Add(Model.banqi_attach model)      {           StringBuilder strSql = new StringBuilder();           strSql.Append("insert into banqi_attach(");           strSql.Append("[bqid],[file_name] ,[file_path] ,[file_size],[create_time] )");           strSql.Append(" values (");           strSql.Append("@bqid,@file_name,@file_path,@file_size,@create_time)");           strSql.Append(";select @@IDENTITY");           SqlParameter[] parameters = {            new SqlParameter("@bqid", SqlDbType.NVarChar,20),                               new SqlParameter("@file_name", SqlDbType.NVarChar,50),                               new SqlParameter("@file_path", SqlDbType.NVarChar,100),                               new SqlParameter("@file_size", SqlDbType.Int),                               new SqlParameter("@create_time", SqlDbType.DateTime)                                            };           parameters[0].Value = model.bqid;           parameters[1].Value = model.file_name;           parameters[2].Value = model.file_path;           parameters[3].Value = model.file_size;           parameters[4].Value = model.create_time;           //添加主表数据           object obj = new SqlHelper().ExecuteScalar(strSql.ToString(), parameters, CommandType.Text);           model.id = Convert.ToInt32(obj);           return model.id;      }      //根据bqid 显示附件列表       public DataTable GetList(string bqid)      {           StringBuilder strSql = new StringBuilder();           strSql.Append("select * from banqi_attach where bqid='"+bqid+"'");           return new SqlHelper().ExecuteQuery(strSql.ToString(), CommandType.Text);      }

四、前台页面:包含一些对上传文件基本属性的验证,如类型、大小等

   班期附件        
     附件名称:
                                 
                                                                     
       
   
  
 

附件列表

                " target="_blank">           />                            暂无记录
" : ""%>    
   
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值