SQL - .NET - SqlParameters - AddWithValue - Are there any negative performance implications when Par
        Posted  
        
            by hamlin11
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by hamlin11
        
        
        
        Published on 2010-05-13T00:15:09Z
        Indexed on 
            2010/05/13
            0:24 UTC
        
        
        Read the original article
        Hit count: 815
        
I'm used to adding sql parameters to a sqlCommand using the add() function. This allows me to specify the type of the sqlParameter, but it requires another line to set the value.
It's nice to use the AddWithValue function, but it skips the "specify the parameter type" step.
I'm guessing this causes the parameters to be sent over as strings contained within single quotes (''), but I'm not sure.
Is this the case, and does this cause significantly slower performance of the stored procedures?
Note: I understand that it is nice to validate user data on the .NET side of things by specifying the data type for params -- I'm only concerned about reflection-type overhead of AddWithValue either on the .NET or SQL side.
© Stack Overflow or respective owner