Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

c# handle dbnull value

int? stockvalue = null;

if (!Convert.IsDBNull(reader["StockValue"]))
    stockvalue = (int)reader["StockValue"];

//Then you can check 

if(stockValue.HasValue)
{
  // do something here.
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: uri file path c# 
Csharp :: get selected item datagrid wpf 
Csharp :: C# select keyword lambda 
Csharp :: c# list.foreach 
Csharp :: c# regex find last match 
Csharp :: how to compare datetime in c# 
Csharp :: export list to excel c# 
Csharp :: c# clear an array 
Csharp :: How to post request C# with returning responsebody 
Csharp :: how to get the size an array in unity 
Csharp :: data annotations in asp.net core 
Csharp :: deserialize json to dynamic object c# 
Csharp :: dapper sql builder where 
Csharp :: c# func 
Csharp :: .net core 6 autofac 
Csharp :: random string generator c# 
Csharp :: to list c# 
Csharp :: c# parse number from string 
Csharp :: c# remove substring 
Csharp :: unity position ui element 
Csharp :: c# get date without time 
Csharp :: c# bool to int 
Csharp :: c# add list to list 
Csharp :: unity deactive all object in list 
Csharp :: Code to disable Debug.log 
Csharp :: c# get last array element 
Csharp :: c# callback param 
Csharp :: unity werfen mit höhe 
Csharp :: c# Modulo 10^9+7 (1000000007) 
Csharp :: Screen.lockcursor unity 
ADD CONTENT
Topic
Content
Source link
Name
3+3 =