Thursday, April 17, 2014

Explicitly Set the MAX Size to SQLParameter Object C#

ByDefault, it will take max 400 characters. E.g.
sqlParameters[1] = new SqlParameter("@usernames", usernames);

We can explicitly Set the MAX Size to SQLParameter Object by the following way:
sqlParameters[1] = new SqlParameter("@usernames", SqlDbType.NVarChar, -1,
                                                usernames);


No comments:

Post a Comment