简体   繁体   English

如何从excel模板中读取数据

[英]How to read data from excel template

I have a excel template am taking it in a datatable i want to read the datatable and save it in database我有一个 excel 模板,将它放入数据表中,我想读取数据表并将其保存在数据库中

my problem is data is not well aligned i want to insert data number wise for eg set of 1 number data then process number 2 data.我的问题是数据没有很好地对齐我想为例如一组 1 号数据插入数据编号,然后处理 2 号数据。 i have two tables one for saving training details and other for participant我有两张桌子,一张用于保存培训细节,另一张用于参与者

var dtsel = dataTable.Select();

i want to process this dtsel datatable.我想处理这个 dtsel 数据表。

i want to read the datatable and save it in database我想读取数据表并将其保存在数据库中

my problem is data is not well aligned我的问题是数据没有很好地对齐

Then just go ahead and align your data in excel...然后继续在excel中对齐您的数据......

One way to do so would be:一种方法是:

  1. Select all your columns in excel.在 excel 中选择所有列。
  2. In data, select the from table/range在数据中,从表/范围中选择

在此处输入图片说明

  1. Select all your data, go to transform and select the fill down option选择所有数据,转到转换并选择填充选项

在此处输入图片说明

  1. Your data should now be well aligned, save the new sheet.您的数据现在应该对齐了,保存新工作表。

在此处输入图片说明 5. Now you can easily import the excel sheet to SQL server, MY SQL or other databases with built in tools 5.现在您可以使用内置工具轻松地将excel表导入到SQL server、MY SQL或其他数据库中

Import data from Excel to SQL Server or Azure SQL Database 将数据从 Excel 导入 SQL Server 或 Azure SQL 数据库

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM