Advertisement
Guest User

Untitled

a guest
May 28th, 2012
514
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. If you ever get this error message trying to build a SqlMetaData object:
  2.  
  3. The dbType NVarChar is invalid for this constructor.
  4. The dbType VarChar is invalid for this constructor.
  5.  
  6. and you have something that looks like:
  7.  
  8. new SqlMetaData("SomeColumnName", SqlDbType.NVarChar)
  9.  
  10. For data type `int` this is ok, but NVarChar and VarChar require an extra parameter
  11.  
  12. new SqlMetaData("SomeColumnName", SqlDbType.NVarChar, 50)
  13.  
  14. w00t.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement