Jump to content

Anyone know a better method of accomplishing this task?


Cassandra

Recommended Posts

  
internal protected DATATYPE Add<DATATYPE>(DATATYPE item1, DATATYPE item2)  
        { 
            return (item1 is string) && (item2 is string) ? (DATATYPE)Convert.ChangeType((item1.ToString() + item2.ToString()), typeof(DATATYPE)) : (DATATYPE)Convert.ChangeType((Convert.ToInt32(item1) + Convert.ToInt32(item2)), typeof(DATATYPE)); 
        } 
  

I will be glad if you know a better way cause I think there are better ways.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...