我有一个texbox,其中我介绍了一个数字,例子是1860812430041。 我称之为文本框的代码部分是:
Convert.ToDouble(cnptxt.Text)
Dim cnpp As Double
cnpp = Val(cnptxt.Text)
Dim cnp As Double
If Me.ClientiTableAdapter.InsertQueryClienti(nume,
prenume, cnp, varsta, adresa, localitate,
datatxt.Value.ToString("yyyy/MM/dd"), starecivila,
numarcopii, venittxt.Text, tipcreditales, rezultat) Then
MsgBox("Adaugat cu succes in baza de date!")
运行应用程序时,我收到错误"算术运算导致溢出"它减轻了If条件。 整个代码是
Convert.ToDouble(cnptxt.Text)
Convert.ToInt32(numarcopiitxt.Text)
Convert.ToInt32(venittxt.Text)
Dim cnpp As Double
cnpp = Val(cnptxt.Text)
Dim nrcopii As Integer
nrcopii = Val(numarcopiitxt.Text)
Dim nume As String
Dim prenume As String
Dim cnp As Double
Dim varsta As Integer
Dim adresa As String
Dim localitate As String
Dim starecivila As String
Dim numarcopii As Integer
Dim data As Date = datatxt.Value.Date
Dim venit As Integer
Dim tipcreditales As String
Dim rezultat As String
nume = numetxt.Text
prenume = prenumetxt.Text
cnp = cnpp
varsta = varstatxt.Text
adresa = adresatxt.Text
localitate = localitatetxt.Text
starecivila = ComboBox2.SelectedItem.ToString()
numarcopii = numarcopiitxt.Text
tipcreditales = ComboBox1.SelectedItem.ToString()
rezultat = rezultattxt.Text
venit = venittxt.Text
data = datatxt.Value.ToString("yyyy/MM/dd")
If Me.ClientiTableAdapter.InsertQueryClienti(nume, prenume, cnp, varsta, adresa, localitate, datatxt.Value.ToString("yyyy/MM/dd"), starecivila, numarcopii, venittxt.Text, tipcreditales, rezultat) Then
MsgBox("Adaugat cu succes in baza de date!")
End If
我尝试插入的数据库表格已将NUMBER设置为已接受。