Geeks With Blogs
Jim Lahman's Blog Fortitude|Endurance|Faith|Teamwork March 2011 Entries
Checking for DBNull
Using a table adapter to a SQL Server database table that returns a NULL record. We determine the fields are NULL by comparing against System.DBNull Looking the NULL records in SQL Management studio Using a table adapter to retrieve a record 1: try 2: { 3: this.vTrackingTableAdapter.... iTrkZone); 4: } 5: catch (Exception ex) 6: { 7: sLogMessage = String 8: .Format("Error getting coil number from tracking table at {0} - {1}", 9: sTrkName, 10: ex.Message); 11: throw ......

Posted On Friday, March 4, 2011 12:46 PM

Converting raw data type to enumerated type
There are times when an enumerated type is preferred over using the raw data type. An example of using a scheme is when we need to check the health of x-ray gauges in use on a production line. Rather than using a scheme like 0, 1 and 2, we can use an enumerated type: 1: /// <summary> 2: /// POR Healthy status indicator 3: /// </summary> 4: /// <remarks>The healthy status is for each POR x-ray gauge; each has its own status.</remarks> 5: [Flags] 6: public enum POR_HEALTH : ......

Posted On Thursday, March 3, 2011 2:35 PM

Copyright © Jim Lahman | Powered by: GeeksWithBlogs.net