Casting Error
In this article, you will know what is Casting Error?
Learn briefly about Casting Error
Error: Cannot implicitly convert type 'int' to 'string'.
string str1 = "abc";
int i = 0;
str1 = i;
Solution: cast ‘int' into ‘string'.
string str1 = "abc";
int i = 0;
str1 = i.ToString();
use the following code -
string str1 = "abc";
int i = 0;
str1 = Convert.ToString(i);
if there is null in the i then it gives error then if possible use the convert statement to avaoid error