Guest User

Untitled

a guest
Jan 22nd, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. public override Data.AdoTypeConverter Initialize(Data.IDataColumn user, Type clr, Data.IAdoTypeConverterRegistry registry, bool secondaryTable)
  2. {
  3. //first we need to ensure that the clr type can be handled by this converter
  4. if (clr == typeof(int) && user.ResolvedSqlType == "varchar")
  5. {
  6. //then we need to set a flag to determine if the type is nullable
  7. nullable = typeof(int?) == clr;
  8.  
  9. //finally return base.Initialize, which ultimatly returns "this"
  10. return base.Initialize(user, clr, registry, secondaryTable);
  11. }
  12.  
  13. //if the converter can not work with the specified clr type we return null
  14. return null;
  15. }
Add Comment
Please, Sign In to add comment