Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Convert from String to Int through datatable.select()

Status
Not open for further replies.

NBartomeli

Programmer
Jul 1, 2003
111
US
I am trying to convert a value in a datatable, which is a string and has to remain that way, to an integer or double value so I can perform a SUM operation on it.

I have tried the following:
Code:
objRow.Item("Total") = objDataReport.Tables("ColL2").Select("Sum(Convert(ColValue,'System.Int32'))")

ColValue is System.String

Any suggestions would be helpfull.
 
I'm going to say that it will depend heavily on what type of database you are using.

-Rick

----------------------

[monkey] I believe in killer coding ninja monkeys.[monkey]
 
SQL Server is the backend that the all of the tables in the dataset are filled from.

I created the table myself, and the type of that column is System.String

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top