Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Detecting null value on Integer
Message
From
26/01/2016 16:35:22
 
 
To
26/01/2016 16:32:55
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
VB 9.0
OS:
Windows 8.1
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01630133
Message ID:
01630264
Views:
46
>When dealing with DataRows its much easier to use the Field (https://msdn.microsoft.com/en-us/library/bb360891%28v=vs.110%29.aspx) and SetField (https://msdn.microsoft.com/en-us/library/bb353039%28v=vs.110%29.aspx) extension methods instead of accessing the fields directly. You can use these methods to get or set the field to a string, nullable int, nullable datetime, etc. without needing to deal with DBNull at all. Sample VB code for retrieving a nullable datetime can be found at http://stackoverflow.com/questions/4158568/populating-a-nullable-type-from-a-datarow.

Thanks
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Reply
Map
View

Click here to load this message in the networking platform