首页 > 解决方案 > 使用 vb.net 或 sql 将值格式转换为其原始格式

问题描述

我在 excel (.csv) 中有一个帐号,我将其读入数据表。帐号5.01E+13在 excel 中显示,因此将其读取到数据表中。而原始值为50100393946569。我需要将 Excel 中的帐号与存储在数据库中的帐号进行比较。如何在 VB 或 SQL 中5.01E+13恢复其原始格式50100393946569

下面是读取excel到数据表的代码

Dim sreader as StreamReader
Dim sstring as String
Dim dt as DataTable
Sreader = File.OpenText(Path.ToString) 'this path is path of the excel


While sreader.Peek <> -1
sstring = sreader.Readline

Dim str as String ()  = sstring.split(",")


Dim rowdt as DataRow
rowdt = dt.NewRow()


For i as Integer = 0 to dt.Columns.count-1

rowdt(i) = str(i).ToString
Next
dt.rows.add(rowdt)


End while

标签: vb.net

解决方案


推荐阅读