| | |
datatype mismatch error
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Sep 2008
Posts: 7
Reputation:
Solved Threads: 0
Hi frnds,,
i hv a form in which i want to calculate balance.I wrote code for this as follows.
But its giving me an error as "Datatype mismatch error". I hv declared bal & amt in database as Currency.Is this proper??If not suggest me some other code plzzzz.
what datatype should I specify for these two variables??
Dim bal, amt As Integer
If (cmbtrans.SelectedItem = "DEPOSIT") Then
bal = 0
amt = Val(txtamt.Text)
bal = bal + amt
txtbalance.Text = bal
End If
i hv a form in which i want to calculate balance.I wrote code for this as follows.
But its giving me an error as "Datatype mismatch error". I hv declared bal & amt in database as Currency.Is this proper??If not suggest me some other code plzzzz.
what datatype should I specify for these two variables??
Dim bal, amt As Integer
If (cmbtrans.SelectedItem = "DEPOSIT") Then
bal = 0
amt = Val(txtamt.Text)
bal = bal + amt
txtbalance.Text = bal
End If
•
•
Join Date: Nov 2008
Posts: 8
Reputation:
Solved Threads: 0
•
•
•
•
Hi frnds,,
i hv a form in which i want to calculate balance.I wrote code for this as follows.
But its giving me an error as "Datatype mismatch error". I hv declared bal & amt in database as Currency.Is this proper??If not suggest me some other code plzzzz.
what datatype should I specify for these two variables??
Dim bal, amt As Integer
If (cmbtrans.SelectedItem = "DEPOSIT") Then
bal = 0
amt = Val(txtamt.Text)
bal = bal + amt
txtbalance.Text = bal
End If
re:
Better You can Use Double
i.e
Dim bal, amt as Double
Because amount are having decimal values.
like 0.00
and also change database Datatype to money or float(in sqlserver2000)
![]() |
Similar Threads
- Help with asp error (ASP)
Other Threads in the VB.NET Forum
- Previous Thread: Message Box
- Next Thread: Installation help
| Thread Tools | Search this Thread |
Tag cloud for VB.NET
.net .net2008 2008 access advanced application array basic beginner browser button buttons center click client code combo convert cuesent data database datagrid datagridview date datetimepicker designer dissertation dissertations dissertationtopic eclipse excel exists fade filter forms function html images input lib listview map mobile module monitor msaccess net number objects open panel pdf picturebox picturebox2 port position print printing problem read regex remove right-to-left save search serial settings shutdown socket sorting sqldatbase sqlserver survey temperature textbox timer timespan transparency txttoxmlconverter user usercontol validation vb vb.net vb2008 vba vbnet visual visualbasic visualbasic.net visualstudio.net visualstudio2008 web webbrowser winforms winsock wpf wrapingcode xml year





