Introduction:
Here I will explain how to solve the problem of “cannot convert string to type 'Double' is not valid” in vb.net. To solve this problem we need to use ‘&’ or ‘CStr’ formats in string while assigning integer values to string in vb.net.
Description:
Here I will explain how to solve the problem of “cannot convert string to type 'Double' is not valid” in vb.net. To solve this problem we need to use ‘&’ or ‘CStr’ formats in string while assigning integer values to string in vb.net.
Description:
In
previous posts I explained save files in folder and download in
asp.net,
read or write text file in asp.net, upload and download files from database
in asp.net,
download multiple files as zip folder
in asp.net
and many articles relating to solve errors in asp.net, SQL
Server, IIS, etc. Now I will
explain how to solve the problem of “cannot
convert string to type 'Double' is not valid” in vb.net.
In
one application when I tried to concatenate string value with integer values in vb.net that time I got error like as shown below
|
Actually
in vb.net we need to use ‘&’ or ‘CStr’ operators instead of ‘+’
operator for concatenation. We can follow different type methods to fix this
problem in
vb.net
Method 1:
lblMsg.Text = "Your Password Wrong
you have only " & (3 - attempts) & " attempts"
|
Method 2:
lblMsg.Text = "Your Password Wrong
you have only " + CStr(3 -
attempts) + " attempts"
|
Method 3:
lblMsg.Text = String.Format("Your Password Wrong you have only {0}
attempts", (3 - attempts))
|
I
hope it helps you to solve your problem. Happy Coding……
If you enjoyed this post, please support the blog below. It's FREE! Get the latest Asp.net, C#.net, VB.NET, jQuery, Plugins & Code Snippets for FREE by subscribing to our Facebook, Twitter, RSS feed, or by email. |
|||
|
|||
1 comments :
yes, I also often face this problem, but the way you described it, so far brilliant. Keep it Up, we all learning and enhancing on page skills from you.
Note: Only a member of this blog may post a comment.