Skip to main content
January 6, 2008
Question

having trouble with C# dynamic text

  • January 6, 2008
  • 1 reply
  • 210 views
works in VB.NET but not C#.NET

<%# rs1.FieldValue("TotalCount1", Container) * 49 + rs2.FieldValue("TotalCount2", Container) %>

Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0019: Operator '*' cannot be applied to operands of type 'string' and 'int'

This topic has been closed for replies.

1 reply

January 6, 2008
<%# Convert.ToInt32(rs1.FieldValue("TotalCount1", Container)) * 49 + Convert.ToInt32(rs2.FieldValue("TotalCount2", Container)) %>

The difference between VB.NET and C#.NET can be night and day it feels like (as I wonder why I'm torturing myself to learn a 4th language for develop in... ASP, PHP, and VB.NET works just fine)