上传Excel文件并将Excel中某Sheet表的数据存储到数据
2017-06-16 本文已影响65人
BigbyLong
实现过程:
1.上传文件:首先判断是否含有文件,文件名是否正确,拼接文件名以及存储路径,上传文件;
2.将Excel表数据导入数据库:首先将Sheet填充到DataTable中,再判断Sheet表中相应的字段值是否符合数据库中的存储类型,符合则保存,不符合则提示,return;











DA方法:


存储过程:


实现过程:
1.上传文件:首先判断是否含有文件,文件名是否正确,拼接文件名以及存储路径,上传文件;
2.将Excel表数据导入数据库:首先将Sheet填充到DataTable中,再判断Sheet表中相应的字段值是否符合数据库中的存储类型,符合则保存,不符合则提示,return;
DA方法:
存储过程: