问题描述
我有一个excel文件,我设法进行了一些计算。我知道当前桥梁的资产价值。我在文件中有21个字段。在21个字段中,有7个字段只是关于桥,其余用于基于各种条件的计算。我有超过500条记录。
现在我想用vb.net做同样的事情如果可能的话。
1.读取某些字段并将其存储在数据库中。(保存桥信息的字段)。
2.执行计算时读取其余字段最后存储它们。
是否有一篇文章或资源可以提及相同的想法?由于Web中的大多数文章仅显示您可以将数据从excel导入数据库。
I have an excel file that i managed to perform some calculation.It's to know the asset value of bridges in a current year.I have 21 fields in the file.Out of the 21 fields,seven fields are just information about the bridge,the rest are used for the calculation based on various conditions.And i have more than 500 records.
Now i wanted to do the same thing using vb.net if it's possible.
1.Read certain fields and store them in the database.(Fields holding bridge information).
2.Read the rest of the fields while performing calculation and lastly store them.
Is there an article or resource to refer to that mentions the same idea? Since most of the articles in the web only show that you can just import data from excel to a database.
推荐答案
SELECT A, B, A + B AS Result FROM MyTable
但是你可以;只是获取一个excel公式并将其传递给SQL进行评估。
But you can;t just grab an excel formula and pass it to SQL for evaluation.
SELECT Name, Price, Qty, '=[@Price]*[@Qty]' AS [Sum] FROM ...
如果您肯定想使用vb.net,您可能会得到计算的单元格值使用Range.Value属性。
If you definitely want to use vb.net, you may get calculated cell values using the Range.Value property.
这篇关于通过计算将excel数据导入数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!