DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Use Iif Construct For Creating New Column In Datatable

01.31.2012
| 2169 views |
  • submit to reddit
        IF construct in expression while adding new column to datatable

mydatatable.Columns.Add("CustomerTypeBasedOnExpenditure", System.Type.GetType("System.String"),"IIF(customertotal>1000, 'Good customer', 'Bad Customer')" );