Last post Aug 11, 2008 06:11 AM by raoofahmedkhan
Aug 09, 2008 02:53 AM|raoofahmedkhan|LINK
I have a problem while converting code from C# to VB.Net, my code works properly when i run it in C# but creates problem when it is called in VB.Net code behind. The code is as follows. Kindly show me where i am going wrong.
total += (theGrid.rows[rowIdx].cells[i].children.children.value - 0);
theGrid.rows[rowIdx].cells[noofcols].children.children.value = total;
The above code is working fine. But the same thing VB.Net is giving me problem.
Error message is : Conversion from string "updateValue(ctl00_ContentPlaceMa" to type 'Double' is not valid.
Aug 09, 2008 04:11 AM|wisccal|LINK
Either do this:
evtHandler = "updateValue(" + GridView1.ClientID +
"," + intLRowIndex.ToString() +
Or replace + with &:
evtHandler = "updateValue(" & GridView1.ClientID &
"," & intLRowIndex &
In VB, the &-Operator is solely for string concatenation, while + is usually for adding numbers. The former operator will always convert non-string values to strings and the concatenate them, while the latter uses several rules to determine what to do. In
your case, it is trying to promote the string to a Double, because one operand is a string and the other is a numeric value.
All explained here
Aug 09, 2008 07:14 AM|raoofahmedkhan|LINK
Thanks in advance.
Aug 11, 2008 06:11 AM|raoofahmedkhan|LINK