摘要
介绍了在ASP.NET中实现Excel表格与SQL Server交互的方法,并提供了源代码。使用sqlbulkcopy.Column-Mappings.Add)(和sqlbulkcopy.WriteTOServer)(方法解决导入数据的匹配和效率问题;用添加CSS代码和控制控件的属性来解决导出数据的预处理问题,并以湖南省水库移民数据库系统为例进行了实验。实验表明,所采用的方法能很好地解决Excel与数据库的交互问题,有较好的实用性。
The method of implementing the interaction between Excel form and SQL Server in ASP.NET is introduced and the source code is provided. The matching and efficiency problems of importing data are solved by using the methods of sqlbulkcopy.ColumnMappings.Add() and sqlbulkcopy.WriteTOServer(),the preprocessing problem of exporting data is solved by adding CSS code and control attributes,and the experiments are done in the example of Hunan province reservoir resettlement database system. The experiments show that the method can solve the problem of interaction between Excel and database well,and has good practicability.
出处
《计算机时代》
2010年第7期31-33,共3页
Computer Era