使用bo,bll,dal和userinterface将csv文件上传到sql服务器 [英] upload a csv file using bo,bll ,dal and userinterface into sql server

查看:105
本文介绍了使用bo,bll,dal和userinterface将csv文件上传到sql服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用bo,bll,dal和用户界面将csv文件上传到sqlserver数据库中
请给我发代码

upload a csv file into sqlserver database using bo,bll ,dal and userinterface
please send me the code

推荐答案

开始 ^ ].




您不会获得所需的确切代码,但是人们可以引导您开发这种功能.

上载CSV文件可分为两个小部分.第一部分是解析CSV文件并将其转换为Business对象,然后第二部分是将该Business Object值插入数据库.

对于第一部分,您需要创建一个读取CSV文件的函数,将CSV文件的值拆分为Array,最后创建一个Business对象并逐个分配值.

其次,您可以将该业务对象传递给业务逻辑层(BLL)的插入函数之一,以进行验证和解析操作,然后,它将将该对象传递给数据访问层(DAL)进行数据库操作.

希望您可以非常轻松地完成第一部分,对于第二部分,请参考
Hi,

You will not get exact code of what you want but people can guide you to develop such kind of functionality.

Uploading CSV file can be divided in two small parts. First part is to parse your CSV file and convert it into Business object and then second part is to insert that Business Object value into database.

For the First part you need to create one function that read CSV file, Split CSV file value into Array and at last Create one Business object and assign value one by one.

Secondly you can pass that Business object to one of the Insert function of your Business Logic Layer(BLL) for validation and parsing operation and further it will pass that object to Data Access Layer(DAL) for database operation.

I hope you can do First part very easily, For the second part please refer Insert, Update, Search and Delete (CRUD operation) using ASP.Net and MySQL[^] Article. Although It shows MySQL database interaction but you can change your Stored Procedure to work with MsSQL.

Hope this information is sufficient to start working on it. In between if you have any doubt you can raise new Question in CP.

Best of luck

Thanks
-Amit Gajjar


这篇关于使用bo,bll,dal和userinterface将csv文件上传到sql服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆