本文介绍了转换溢出且数值太大而不适合96位十进制。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好;



我有一个表,其结构如下: -



名称数据类型允许空白

Id int已检查

名称nchar(10)已检查

金额数字(38,20)已检查

销售小数(38,20)已检查



我有一个问题,我通过执行查询从sql绑定表格



从[96bitIssue]中选择*



此表中的数据格式为



ID ID名称销售额

3 aa 715894125.38461538459812461538 757654312.38461538461538461538

4 xdf 753694125.38461538459812461538 757654312.38461538461538461538

5 Neha 235694125.38461538459812461538 757654312.38461538461538461538

6 sandeep 452694125.38461538459812461538 757654312.38 461538461538461538

7 scf 484562125.38461538459812461538



当我使用OleDb Connection我收到此错误

数值值太大,无法容纳96位小数。

使用以下代码..

Hello ;

I have a Table whose structure is as follows:-

Name DataType Allow null
Id int Checked
Name nchar(10) Checked
Amount numeric(38, 20) Checked
sales decimal(38,20) checked

I have an issue in which I am binding a table from sql by executing query

select * from [96bitIssue]

in this table the data are in this format

IDName Amount Sales
3aa715894125.38461538459812461538757654312.38461538461538461538
4xdf753694125.38461538459812461538757654312.38461538461538461538
5Neha235694125.38461538459812461538757654312.38461538461538461538
6sandeep452694125.38461538459812461538757654312.38461538461538461538
7scf484562125.38461538459812461538757654312.38461538461538461538

When I am using OleDb Connection I am getting this error
The numerical value is too large to fit into a 96 bit decimal.
using following code..

Dim OLEDB_Con As OleDbConnection = New OleDbConnection("Provider=SQLOLEDB;Data Source=NEHA,1433;Initial Catalog=Test;User Id=sa;Password=sa@1234")
Dim da As New OleDbDataAdapter("select * from [dbo].[96bitIssue]", OLEDB_Con)            
Dim dt As DataTable = New DataTable()
OLEDB_Con.Open()
da.Fill(dt)
GridControl1.DataSource = dt







当使用SQLConnection时我得到错误转换溢出




And when using SQLConnection I get error Conversion overflows

Dim SQlCon As SqlConnection = New SqlConnection("Data Source=NEHA,1433;Initial Catalog=Test;User Id=sa;Password=sa@1234")
Dim da As New SqlDataAdapter("select * from [dbo].[96bitIssue]", SQlCon)
Dim dt As DataTable = New DataTable()
SQlCon.Open()
da.Fill(dt)
GridControl1.DataSource = dt







请帮助我.....

我们到底出了什么问题,为此解决了什么问题......




Kindly Please help me.....
Exactly we are getting wrong and whats the solution for it......

推荐答案


SELECT ID, Name, ROUND(Amount, 2) as Amount, ROUND(Sales, 2) as Sales FROM ...



另请参阅 []。


这篇关于转换溢出且数值太大而不适合96位十进制。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-31 02:34