Readdy Write  
0,00 €
Your View Money
Views: Count
Self 20% 0
Your Content 60% 0

Users by Links 0
u1*(Content+Views) 10% 0
Follow-Follower 0
s2*(Income) 5% 0

Count
Followers 0
Login Register as User
Fehler ;

Fehler: Vergleich row==System.DBNull DBNull is a type, which is not valid in the given context

06.10.2021 (👁502)

 

 

Fehler:

Severity

Code

Description

Error

CS0119

'DBNull' is a type, which is not valid in the given context

 

 

string sMonth01 = ProductDate.dtMonth.ToString("yyyy-MM-01");

if (row[sMonth01] == System.DBNull) {

  row[sMonth01] = ProductDate.dtMonth.ToString("yyyy-MM-dd");

 }

  else

  {

  row[sMonth01] = row[sMonth01] + ", " + ProductDate.dtMonth.ToString("yyyy-MM-dd");

  }

 

Ein Bild, das Text enthält.

Automatisch generierte Beschreibung

 

 

 

Lösung:

row[sMonth01] is System.DBNull

 

 

string sMonth01 = ProductDate.dtMonth.ToString("yyyy-MM-01");

if (row[sMonth01] is System.DBNull) {

  row[sMonth01] = ProductDate.dtMonth.ToString("yyyy-MM-dd");

  }

  else

  {

  row[sMonth01] = row[sMonth01] + ", " + ProductDate.dtMonth.ToString("yyyy-MM-dd");

  }

Ein Bild, das Text enthält.

Automatisch generierte Beschreibung