how to convert string to integer?

how to convert string to integer?

Post by Stephane Via » Fri, 30 Aug 2002 04:32:11



how to convert string to integer?
inserted, updated and unchanged are column values which i want to add
together
ds.Tables(0).Columns("total_records").Expression = "inserted + updated +
unchanged"

thanks

stephane

 
 
 

how to convert string to integer?

Post by Peter O'Reill » Fri, 30 Aug 2002 04:44:04


Quote:> how to convert string to integer?

By using the System.Convert object.

e.g.,
ds.Tables(0).Columns("total_records") = System.Convert.ToInt32(inserted) +
System.Convert.ToInt32(updated ) + ......;

--
Peter O'Reilly

 
 
 

how to convert string to integer?

Post by Ian McWilliam » Fri, 30 Aug 2002 06:04:37


Use Integer.Parse()
e.g.
ds.Tables(0).Columns("total_records").Expression =
Integer.Parse(inserted) + Integer.Parse(updated) + Integer.Parse(unchanged)

In C# it's int.Parse.

Hope that helps,

Ian


Quote:> how to convert string to integer?
> inserted, updated and unchanged are column values which i want to add
> together
> ds.Tables(0).Columns("total_records").Expression = "inserted + updated +
> unchanged"

> thanks

> stephane