Guest User

Untitled

a guest
Jan 22nd, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. public override bool CreateLiteralSql(ref Data.DataHolder holder)
  2. {
  3. //If there is no value, then we want to query against null.
  4. if (holder.NoValue)
  5. {
  6. holder.StringValue = "NULL";
  7.  
  8. //returning false indicates that no quotes are required. We want NULL instead of 'NULL'
  9. return false;
  10. }
  11. else
  12. {
  13. //convert the int value into a string, since that is what we are storing it as in the db
  14. holder.StringValue = holder.Int32Value.ToString();
  15.  
  16. // return true indicates that quotes are needed around the value
  17. return true;
  18. }
  19. }
Add Comment
Please, Sign In to add comment