Guest User

Untitled

a guest
Jan 22nd, 2018
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. public override void Write(ref Data.DataHolder holder)
  2. {
  3. //set the db type
  4. holder.Parameter.DbType = System.Data.DbType.String;
  5.  
  6. //if there is no value we could specify what to set the db field to
  7. if (holder.NoValue)
  8. {
  9. //in this case we just want to set it to null
  10. holder.Parameter.Value = null;
  11. }
  12. else
  13. {
  14. //When there is a value we simply need to take our CLR int, and convert it to a string
  15. //and then set the parameter info
  16. string s = holder.Int32Value.ToString();
  17. holder.Parameter.Size = s.Length;
  18. holder.Parameter.Value = s;
  19. }
  20. }
Add Comment
Please, Sign In to add comment